Require FAT to occupy at least one sector.

Obtained from:	Android https://r.android.com/1205830
MFC after:	3 days
This commit is contained in:
delphij 2020-01-11 03:59:06 +00:00
parent 24da5d4511
commit d705f2ff45

View File

@ -250,7 +250,7 @@ readboot(int dosfs, struct bootblock *boot)
boot->FATsecs = boot->bpbFATsmall;
}
if (boot->FATsecs > UINT32_MAX / boot->bpbFATs) {
if (boot->FATsecs < 1 || boot->FATsecs > UINT32_MAX / boot->bpbFATs) {
pfatal("Invalid FATs(%u) with FATsecs(%zu)",
boot->bpbFATs, (size_t)boot->FATsecs);
return FSFATAL;