From 0927e5bdc825e028f4a8df3f124fe2eb0fe62e76 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sun, 20 Oct 2013 16:33:12 +0200 Subject: [PATCH] * grub-core/fs/udf.c: Remove variable length arrays. Increases udf.mod by 128 bytes (but decreases by 13 compressed when compressed). --- ChangeLog | 6 ++++++ grub-core/fs/udf.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5382a03e4..8e68fc451 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-10-20 Vladimir Serbinenko + + * grub-core/fs/udf.c: Remove variable length arrays. + Increases udf.mod by 128 bytes (but decreases by 13 compressed when + compressed). + 2013-10-20 Vladimir Serbinenko * grub-core/fs/iso9660.c: Remove variable length arrays. diff --git a/grub-core/fs/udf.c b/grub-core/fs/udf.c index 8f3305367..60ce92830 100644 --- a/grub-core/fs/udf.c +++ b/grub-core/fs/udf.c @@ -216,6 +216,7 @@ struct grub_udf_file_ident struct grub_udf_tag tag; grub_uint16_t version_num; grub_uint8_t characteristics; +#define MAX_FILE_IDENT_LENGTH 256 grub_uint8_t file_ident_length; struct grub_udf_long_ad icb; grub_uint16_t imp_use_length; @@ -909,7 +910,7 @@ grub_udf_iterate_dir (grub_fshelp_node_t dir, { enum grub_fshelp_filetype type; char *filename; - grub_uint8_t raw[dirent.file_ident_length]; + grub_uint8_t raw[MAX_FILE_IDENT_LENGTH]; type = ((dirent.characteristics & GRUB_UDF_FID_CHAR_DIRECTORY) ? (GRUB_FSHELP_DIR) : (GRUB_FSHELP_REG));