* 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:
parent
7acd2ae1fb
commit
cf1adfdff5
2 changed files with 10 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue