* grub-core/fs/udf.c (read_string): Macroify GRUB_MAX_UTF8_PER_UTF16.
* grub-core/fs/jfs.c (grub_jfs_diropen): Likewise. * grub-core/fs/fat.c (grub_fat_iterate_dir): Likewise.
This commit is contained in:
parent
53072f9b96
commit
78c2cd1c62
4 changed files with 10 additions and 4 deletions
|
@ -820,7 +820,7 @@ read_string (grub_uint8_t *raw, grub_size_t sz)
|
|||
for (i = 0; i < utf16len; i++)
|
||||
utf16[i] = (raw[2 * i + 1] << 8) | raw[2*i + 2];
|
||||
}
|
||||
ret = grub_malloc (utf16len * 3 + 1);
|
||||
ret = grub_malloc (utf16len * GRUB_MAX_UTF8_PER_UTF16 + 1);
|
||||
if (ret)
|
||||
*grub_utf16_to_utf8 ((grub_uint8_t *) ret, utf16, utf16len) = '\0';
|
||||
grub_free (utf16);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue