OSDN Git Service

Check FAT count on mount.
authorresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Sat, 24 Apr 2010 07:13:05 +0000 (07:13 +0000)
committerresver <resver@60bc1c72-a15a-11de-b98f-4500b42dc123>
Sat, 24 Apr 2010 07:13:05 +0000 (07:13 +0000)
git-svn-id: http://exfat.googlecode.com/svn/trunk@131 60bc1c72-a15a-11de-b98f-4500b42dc123

libexfat/mount.c

index 369a74d..31f928a 100644 (file)
@@ -136,6 +136,13 @@ int exfat_mount(struct exfat* ef, const char* spec, const char* options)
                                fs_version >> 8, fs_version & 0xff);
                return -EIO;
        }
+       if (ef->sb->fat_count != 1)
+       {
+               close(ef->fd);
+               free(ef->sb);
+               exfat_error("unsupported FAT count: %hhu", ef->sb->fat_count);
+               return -EIO;
+       }
        /* officially exFAT supports cluster size up to 32 MB */
        if ((int) ef->sb->block_bits + (int) ef->sb->bpc_bits > 25)
        {