+2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/fs/ntfs.c: Remove variable length arrays.
+ Increases ntfs.mod by 64 bytes (but decreases by 3 when
+ compressed).
+
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/hfs.c: Remove variable length arrays.
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/udf.c: Remove variable length arrays.
- Increases udf.mod by 128 bytes (but decreases by 13 compressed when
+ Increases udf.mod by 128 bytes (but decreases by 13 when
compressed).
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/iso9660.c: Remove variable length arrays.
- Increases iso9660.mod by 200 bytes (but decreases by 79 compressed when
+ Increases iso9660.mod by 200 bytes (but decreases by 79 when
compressed).
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/nilfs2.c: Remove variable length arrays.
- Increases nilfs2.mod by 24 bytes (but decreases by 115 compressed when
+ Increases nilfs2.mod by 24 bytes (but decreases by 115 when
compressed).
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
if (ustr == NULL)
return 0;
{
- grub_uint16_t tmp[ns];
+ grub_uint16_t tmp[256];
int i;
for (i = 0; i < ns; i++)
tmp[i] = grub_le_to_cpu16 (grub_get_unaligned16 ((char *) np
if ((pa) && (pa[8] == 0) && (u32at (pa, 0x10)))
{
grub_uint8_t *buf;
+ grub_uint16_t *tmp;
int len;
+ int i;
len = u32at (pa, 0x10) / 2;
buf = grub_malloc (len * 4 + 1);
+ tmp = grub_malloc (len * 2);
+ if (!buf || !tmp)
+ {
+ grub_free (buf);
+ grub_free (tmp);
+ goto fail;
+ }
pa += u16at (pa, 0x14);
- {
- grub_uint16_t tmp[len];
- int i;
- for (i = 0; i < len; i++)
- tmp[i] = grub_le_to_cpu16 (grub_get_unaligned16 (pa + 2 * i));
- *grub_utf16_to_utf8 (buf, tmp, len) = '\0';
- }
+ for (i = 0; i < len; i++)
+ tmp[i] = grub_le_to_cpu16 (grub_get_unaligned16 (pa + 2 * i));
+ *grub_utf16_to_utf8 (buf, tmp, len) = '\0';
+ grub_free (tmp);
*label = (char *) buf;
}