Check exFAT boot sector validity when listing files
This commit is contained in:
parent
ef199744f7
commit
04e8b22064
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue