diff --git a/ChangeLog b/ChangeLog index 63dbdb333..5382a03e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,13 @@ +2013-10-20 Vladimir Serbinenko + + * grub-core/fs/iso9660.c: Remove variable length arrays. + Increases iso9660.mod by 200 bytes (but decreases by 79 compressed when + compressed). + 2013-10-20 Vladimir Serbinenko * grub-core/fs/nilfs2.c: Remove variable length arrays. - Increases xfs.mod by 24 bytes (but decreases by 115 compressed when + Increases nilfs2.mod by 24 bytes (but decreases by 115 compressed when compressed). 2013-10-20 Vladimir Serbinenko diff --git a/grub-core/fs/iso9660.c b/grub-core/fs/iso9660.c index cdbd6dc36..731c024dd 100644 --- a/grub-core/fs/iso9660.c +++ b/grub-core/fs/iso9660.c @@ -79,6 +79,7 @@ struct grub_iso9660_dir struct grub_iso9660_date2 mtime; grub_uint8_t flags; grub_uint8_t unused2[6]; +#define MAX_NAMELEN 255 grub_uint8_t namelen; } __attribute__ ((packed)); @@ -328,11 +329,11 @@ grub_iso9660_convert_string (grub_uint8_t *us, int len) { char *p; int i; - grub_uint16_t t[len]; + grub_uint16_t t[MAX_NAMELEN / 2 + 1]; p = grub_malloc (len * GRUB_MAX_UTF8_PER_UTF16 + 1); if (! p) - return p; + return NULL; for (i=0; i