Do not allow HFS partition with 0 allocation block.

This commit is contained in:
Christophe Grenier 2008-12-29 08:14:07 +01:00
parent bb4d75d006
commit 30ccc2bf64

View file

@ -91,6 +91,9 @@ int test_HFS(disk_t *disk_car, const hfs_mdb_t *hfs_mdb,partition_t *partition,c
/* Check for valid blocksize */
if(be32(hfs_mdb->drAlBlkSiz)%512!=0 || be32(hfs_mdb->drAlBlkSiz)==0)
return 1;
/* Check for valid number of allocation blocks */
if(be16(hfs_mdb->drNmAlBlks)==0)
return 1;
/* Check for coherent block numbers */
if(be16(hfs_mdb->drFreeBks) > be16(hfs_mdb->drNmAlBlks))
return 1;