* grub-core/gettext/gettext.c (grub_mofile_open): Call

grub_gettext_delete_list before changing grub_gettext_max to avoid
	running out of array bounds.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-28 11:50:53 +01:00
parent 7acd2ae1fb
commit cf1adfdff5
2 changed files with 10 additions and 3 deletions

View file

@ -1,9 +1,15 @@
2012-02-27 Vladimir Serbinenko <phcoder@gmail.com>
2012-02-28 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/gettext/gettext.c (grub_mofile_open): Call
grub_gettext_delete_list before changing grub_gettext_max to avoid
running out of array bounds.
2012-02-28 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/term/i386/pc/vga_text.c: Add GRUB_MACHINE_MULTIBOOT to
grub_vga_text_init/grub_vga_text_fini.
2012-02-27 Vladimir Serbinenko <phcoder@gmail.com>
2012-02-28 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/loader/i386/xnu.c (grub_xnu_boot): Fix format specification.

View file

@ -257,6 +257,8 @@ grub_mofile_open (const char *filename)
"mo: invalid mo version in file: %s", filename);
}
grub_gettext_delete_list ();
grub_gettext_offset_original = grub_le_to_cpu32 (head.offset_original);
grub_gettext_offset_translation = grub_le_to_cpu32 (head.offset_translation);
grub_gettext_max = grub_le_to_cpu32 (head.number_of_strings);
@ -266,7 +268,6 @@ grub_mofile_open (const char *filename)
grub_file_close (fd_mo);
fd_mo = 0;
grub_gettext_delete_list ();
grub_gettext_msg_list = grub_zalloc (grub_gettext_max
* sizeof (grub_gettext_msg_list[0]));
if (!grub_gettext_msg_list)