From: fzielcke Date: Mon, 9 Feb 2009 14:17:19 +0000 (+0000) Subject: 2009-02-09 Felix Zielcke X-Git-Tag: 1.98~1134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6dca6fe432cdd3659973f688ca066c7698149beb;p=thirdparty%2Fgrub.git 2009-02-09 Felix Zielcke fs/fat.c (grub_fat_mount): Try to avoid false positives by checking bpb.version_specific.fat12_or_fat16.fstype and bpb.version_specific.fat32.fstype. --- diff --git a/ChangeLog b/ChangeLog index 440f2cebc..9dd5df219 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-02-09 Felix Zielcke + + fs/fat.c (grub_fat_mount): Try to avoid false positives by checking + bpb.version_specific.fat12_or_fat16.fstype and + bpb.version_specific.fat32.fstype. + 2009-02-08 Robert Millan * fs/tar.c: Replace "fs/cpio.c" with "cpio.c". diff --git a/fs/fat.c b/fs/fat.c index d62adbc27..6b39ef0f6 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -187,6 +187,11 @@ grub_fat_mount (grub_disk_t disk) if (grub_disk_read (disk, 0, 0, sizeof (bpb), (char *) &bpb)) goto fail; + if (! grub_strncmp((const char *) bpb.version_specific.fat12_or_fat16.fstype, "FAT12",5) + || ! grub_strncmp((const char *) bpb.version_specific.fat12_or_fat16.fstype, "FAT16",5) + || ! grub_strncmp((const char *) bpb.version_specific.fat32.fstype, "FAT32",5)) + goto fail; + /* Get the sizes of logical sectors and clusters. */ data->logical_sector_bits = fat_log2 (grub_le_to_cpu16 (bpb.bytes_per_sector));