* conf/Makefile.common (CFLAGS_GNULIB): Add

-Wno-unsafe-loop-optimizations.
	* configure.ac: Remove -Wmissing-declarations and -Wmissing-prototypes
	on tools.
	* grub-core/commands/legacycfg.c: Add pragma to skip
	-Wunsafe-loop-optimizations.
	(check_password_md5_real): Fix loop counter type.
	* grub-core/commands/testload.c (grub_cmd_testload): Fix over the EOF
	reading.
	* grub-core/disk/ldm.c (grub_util_get_ldm): Fix logic error.
	* grub-core/fs/zfs/zfs_sha256.c (zio_checksum_SHA256): Add safety
	loop condition.
	* grub-core/io/gzio.c: Add pragma to skip -Wunsafe-loop-optimizations.
	* grub-core/lib/LzmaEnc.c (GetOptimum): Avoid possible infinite loop.
	* grub-core/net/net.c (grub_net_route_address): Add safety loop
	condition.
	* grub-core/normal/charset.c (bidi_line_wrap): Likewise.
	* grub-core/normal/cmdline.c (grub_set_history): Fix loop types and
	avoid possible infinite loops.
	* grub-core/script/parser.y: Add pragma to skip -Wmissing-declarations
	and -Wunsafe-loop-optimizations.
	* grub-core/script/yylex.l: Likewise.
	* util/grub-mkfont.c: Add pragma to skip -Wunsafe-loop-optimizations.
	(print_glyphs): Avoid infinite loops.
	* util/grub-mkimage.c (compress_kernel_xz): Fix format security.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-24 12:30:32 +01:00
parent 697f18b067
commit 4e27343fb0
16 changed files with 74 additions and 27 deletions

View file

@ -681,6 +681,8 @@ write_be16_section (const char *name, grub_uint16_t data, int* offset,
*offset += 10;
}
#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
static void
print_glyphs (struct grub_font_info *font_info)
{
@ -717,7 +719,7 @@ print_glyphs (struct grub_font_info *font_info)
bitmap = glyph->bitmap;
mask = 0x80;
for (y = ymax - 1; y >= ymin; y--)
for (y = ymax - 1; y > ymin - 1; y--)
{
int line_pos;

View file

@ -625,7 +625,7 @@ compress_kernel_xz (char *kernel_img, size_t kernel_size,
xzret = lzma_stream_encoder (&strm, fltrs, LZMA_CHECK_NONE);
if (xzret != LZMA_OK)
grub_util_error (_("cannot compress the kernel image"));
grub_util_error ("%s", _("cannot compress the kernel image"));
*core_img = xmalloc (kernel_size);
@ -642,7 +642,7 @@ compress_kernel_xz (char *kernel_img, size_t kernel_size,
continue;
if (xzret == LZMA_STREAM_END)
break;
grub_util_error (_("cannot compress the kernel image"));
grub_util_error ("%s", _("cannot compress the kernel image"));
}
*core_size -= strm.avail_out;