summaryrefslogtreecommitdiffstats
path: root/src/exfat_dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-06-30 09:16:07 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2011-06-30 09:16:07 +0200
commit04e8b2206447b04a33e2299c7cfa1bcb4f543b43 (patch)
tree668a75b7adb16e79317b379fc76b86af7533fcdd /src/exfat_dir.c
parentef199744f740c3ab07289390e4f21b3f80e3d757 (diff)
Check exFAT boot sector validity when listing files
Diffstat (limited to 'src/exfat_dir.c')
-rw-r--r--src/exfat_dir.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/exfat_dir.c b/src/exfat_dir.c
index d66bd05..3008b66 100644
--- a/src/exfat_dir.c
+++ b/src/exfat_dir.c
@@ -311,6 +311,13 @@ int dir_partition_exfat_init(disk_t *disk, const partition_t *partition, dir_dat
free(exfat_header);
return -1;
}
+ if(le16(exfat_header->signature)!=0xAA55 ||
+ memcmp(exfat_header->oem_id, "EXFAT ", sizeof(exfat_header->oem_id))!=0)
+ {
+ log_error("Not an exFAT boot sector.\n");
+ free(exfat_header);
+ return -1;
+ }
ls=(struct exfat_dir_struct *)MALLOC(sizeof(*ls));
ls->boot_sector=exfat_header;
#ifdef HAVE_ICONV