]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/efi/efi.c: Remove variable length arrays.
authorVladimir Serbinenko <phcoder@gmail.com>
Wed, 4 Dec 2013 07:39:22 +0000 (08:39 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Wed, 4 Dec 2013 07:39:22 +0000 (08:39 +0100)
ChangeLog
grub-core/kern/efi/efi.c

index 5e0da02c5f0d60d3640f835dfa23441e5fb1f922..c1f2b61c7b85efd11cfc66b721c36a18402e8901 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 2a910bbdf6307ef9c75911a771416b8d3012362b..a9b5b3972ea34cbba0f4d0086e21155c1ae97a71 100644 (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: