diff --git a/ChangeLog b/ChangeLog index da706b601..becac92b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-01-31 Vladimir Serbinenko + + * grub-core/fs/fat.c (grub_fat_dir_entry) [MODE_EXFAT]: Expand label + to 15 UTF-16 characters as seen in FS generated by mkexfatfs. + (grub_fat_label) [MODE_EXFAT]: Use macros for size. + 2012-01-31 Vladimir Serbinenko * grub-core/fs/romfs.c (grub_romfs_mount): Fix a bug with labels going diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c index 0569120fb..6adc95c37 100644 --- a/grub-core/fs/fat.c +++ b/grub-core/fs/fat.c @@ -122,8 +122,7 @@ struct grub_fat_dir_entry } __attribute__ ((packed)) file_name; struct { grub_uint8_t character_count; - grub_uint16_t str[11]; - grub_uint8_t reserved[8]; + grub_uint16_t str[15]; } __attribute__ ((packed)) volume_label; } __attribute__ ((packed)) type_specific; } __attribute__ ((packed)); @@ -1046,7 +1045,8 @@ grub_fat_label (grub_device_t device, char **label) if (dir.entry_type == 0x83) { grub_size_t chc; - *label = grub_malloc (11 * 4 + 1); + *label = grub_malloc (ARRAY_SIZE (dir.type_specific.volume_label.str) + * GRUB_MAX_UTF8_PER_UTF16 + 1); if (!*label) { grub_free (data);