From 621e167fd636028d8d40a78ada65cc149da1b8de Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 29 Nov 2013 05:50:32 +0100 Subject: [PATCH] * util/grub-fstest.c: Remove variable length arrays. --- ChangeLog | 4 ++++ util/grub-fstest.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 511f3febd..472e74b59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-11-29 Vladimir Serbinenko + + * util/grub-fstest.c: Remove variable length arrays. + 2013-11-29 Vladimir Serbinenko * grub-core/osdep/linux/ofpath.c: Check return value of read. diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 802733963..ee5880c50 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -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; -- 2.47.2