]> git.proxmox.com Git - grub2.git/commitdiff
* util/grub-fstest.c: Remove variable length arrays.
authorVladimir Serbinenko <phcoder@gmail.com>
Fri, 29 Nov 2013 04:50:32 +0000 (05:50 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Fri, 29 Nov 2013 04:50:32 +0000 (05:50 +0100)
ChangeLog
util/grub-fstest.c

index 511f3febd3eea191b29a4e56c09479817ee640ab..472e74b5963aaebc5eab6740c83dc1ecf83a19d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-29  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/grub-fstest.c: Remove variable length arrays.
+
 2013-11-29  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/osdep/linux/ofpath.c: Check return value of read.
index 802733963a73000c7983b1de79315957a972ea1a..ee5880c506a0dd6061be05c0126879bc20f8d025 100644 (file)
@@ -344,13 +344,14 @@ crc_hook (grub_off_t ofs, char *buf, int len, void *crc_ctx)
 static void
 cmd_crc (char *pathname)
 {
-  grub_uint8_t crc32_context[GRUB_MD_CRC32->contextsize];
+  grub_uint8_t *crc32_context = xmalloc (GRUB_MD_CRC32->contextsize);
   GRUB_MD_CRC32->init(crc32_context);
 
   read_file (pathname, crc_hook, crc32_context);
   GRUB_MD_CRC32->final(crc32_context);
   printf ("%08x\n",
          grub_be_to_cpu32 (grub_get_unaligned32 (GRUB_MD_CRC32->read (crc32_context))));
+  free (crc32_context);
 }
 
 static const char *root = NULL;