diff --git a/ChangeLog b/ChangeLog index ea8804bd1..306358faa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-10-23 Vladimir Serbinenko + + * grub-core/fs/fat.c (grub_fat_label) [MODE_EXFAT]: Set *label to 0 + if no label is found. + (grub_fat_iterate_dir): Fix file size type. + (grub_fat_iterate_dir): Likewise. + 2011-10-23 Vladimir Serbinenko * grub-core/lib/reed_solomon.c (gf_invert): Declare as const and diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c index ae705bcfb..36a43fca0 100644 --- a/grub-core/fs/fat.c +++ b/grub-core/fs/fat.c @@ -485,7 +485,7 @@ grub_fat_read_data (grub_disk_t disk, struct grub_fat_data *data, + data->logical_sector_bits + GRUB_DISK_SECTOR_BITS); logical_cluster = offset >> logical_cluster_bits; - offset &= (1 << logical_cluster_bits) - 1; + offset &= (1ULL << logical_cluster_bits) - 1; if (logical_cluster < data->cur_cluster_num) { @@ -631,9 +631,9 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data, case 0xc0: node.first_cluster = grub_cpu_to_le32 (sec.type_specific.stream_extension.first_cluster); node.valid_size - = grub_cpu_to_le32 (sec.type_specific.stream_extension.valid_size); + = grub_cpu_to_le64 (sec.type_specific.stream_extension.valid_size); node.file_size - = grub_cpu_to_le32 (sec.type_specific.stream_extension.file_size); + = grub_cpu_to_le64 (sec.type_specific.stream_extension.file_size); node.have_stream = 1; break; case 0xc1: @@ -1026,6 +1026,8 @@ grub_fat_label (grub_device_t device, char **label) if (! data) return grub_errno; + *label = NULL; + while (1) { offset += sizeof (dir);