From: Vladimir 'phcoder' Serbinenko Date: Sun, 20 Oct 2013 14:21:02 +0000 (+0200) Subject: * grub-core/fs/iso9660.c: Remove variable length arrays. X-Git-Tag: grub-2.02-beta1~620 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c12ac9773e2f0c081d0ac19e2ee209af5d61ead;p=thirdparty%2Fgrub.git * grub-core/fs/iso9660.c: Remove variable length arrays. Increases iso9660.mod by 200 bytes (but decreases by 79 compressed when compressed). --- 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