* grub-core/kern/efi/efi.c: Remove variable length arrays.

This commit is contained in:
Vladimir Serbinenko 2013-12-04 08:39:22 +01:00
parent 40b5739ff9
commit 47f88cc94e
2 changed files with 13 additions and 4 deletions

View file

@ -1,3 +1,7 @@
2013-12-04 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/efi/efi.c: Remove variable length arrays.
2013-12-04 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/uboot/init.c (uboot_timer_ms): Fix overflow after 71

View file

@ -741,12 +741,17 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp)
case GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE:
{
grub_efi_file_path_device_path_t *fp;
grub_uint8_t buf[(len - 4) * 2 + 1];
grub_uint8_t *buf;
fp = (grub_efi_file_path_device_path_t *) dp;
*grub_utf16_to_utf8 (buf, fp->path_name,
(len - 4) / sizeof (grub_efi_char16_t))
= '\0';
buf = grub_malloc ((len - 4) * 2 + 1);
if (buf)
*grub_utf16_to_utf8 (buf, fp->path_name,
(len - 4) / sizeof (grub_efi_char16_t))
= '\0';
else
grub_errno = GRUB_ERR_NONE;
grub_printf ("/File(%s)", buf);
grub_free (buf);
}
break;
case GRUB_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE: