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:
Xin LI 2020-01-11 03:59:06 +00:00
parent 27a6257130
commit ed0879d944

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;