* grub-core/fs/ntfs.c: Remove variable length arrays.
Increases ntfs.mod by 64 bytes (but decreases by 3 when compressed).
This commit is contained in:
parent
66123940c7
commit
88ce4cd7f6
2 changed files with 23 additions and 11 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,9 @@
|
||||||
|
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>
|
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/fs/hfs.c: Remove variable length arrays.
|
* grub-core/fs/hfs.c: Remove variable length arrays.
|
||||||
|
@ -6,19 +12,19 @@
|
||||||
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/fs/udf.c: Remove variable length arrays.
|
* 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).
|
compressed).
|
||||||
|
|
||||||
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/fs/iso9660.c: Remove variable length arrays.
|
* 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).
|
compressed).
|
||||||
|
|
||||||
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/fs/nilfs2.c: Remove variable length arrays.
|
* 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).
|
compressed).
|
||||||
|
|
||||||
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-10-20 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
|
@ -643,7 +643,7 @@ list_file (struct grub_ntfs_file *diro, grub_uint8_t *pos,
|
||||||
if (ustr == NULL)
|
if (ustr == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
{
|
{
|
||||||
grub_uint16_t tmp[ns];
|
grub_uint16_t tmp[256];
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < ns; i++)
|
for (i = 0; i < ns; i++)
|
||||||
tmp[i] = grub_le_to_cpu16 (grub_get_unaligned16 ((char *) np
|
tmp[i] = grub_le_to_cpu16 (grub_get_unaligned16 ((char *) np
|
||||||
|
@ -1185,18 +1185,24 @@ grub_ntfs_label (grub_device_t device, char **label)
|
||||||
if ((pa) && (pa[8] == 0) && (u32at (pa, 0x10)))
|
if ((pa) && (pa[8] == 0) && (u32at (pa, 0x10)))
|
||||||
{
|
{
|
||||||
grub_uint8_t *buf;
|
grub_uint8_t *buf;
|
||||||
|
grub_uint16_t *tmp;
|
||||||
int len;
|
int len;
|
||||||
|
int i;
|
||||||
|
|
||||||
len = u32at (pa, 0x10) / 2;
|
len = u32at (pa, 0x10) / 2;
|
||||||
buf = grub_malloc (len * 4 + 1);
|
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);
|
pa += u16at (pa, 0x14);
|
||||||
{
|
for (i = 0; i < len; i++)
|
||||||
grub_uint16_t tmp[len];
|
tmp[i] = grub_le_to_cpu16 (grub_get_unaligned16 (pa + 2 * i));
|
||||||
int i;
|
*grub_utf16_to_utf8 (buf, tmp, len) = '\0';
|
||||||
for (i = 0; i < len; i++)
|
grub_free (tmp);
|
||||||
tmp[i] = grub_le_to_cpu16 (grub_get_unaligned16 (pa + 2 * i));
|
|
||||||
*grub_utf16_to_utf8 (buf, tmp, len) = '\0';
|
|
||||||
}
|
|
||||||
*label = (char *) buf;
|
*label = (char *) buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue