mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Detect and handle invalid number of FATs
If the number of FATs field in the boot sector is zero, give
an appropriate error code.
Obtained from: Android 6c29bbe8d5%5E%21/
MFC after: 2 weeks
This commit is contained in:
parent
bcbc8d35eb
commit
7f2b7ec93c
1 changed files with 4 additions and 0 deletions
|
|
@ -87,6 +87,10 @@ readboot(int dosfs, struct bootblock *boot)
|
|||
pfatal("Invalid sector size: %u", boot->bpbBytesPerSec);
|
||||
return FSFATAL;
|
||||
}
|
||||
if (boot->bpbFATs == 0) {
|
||||
pfatal("Invalid number of FATs: %u", boot->bpbFATs);
|
||||
return FSFATAL;
|
||||
}
|
||||
if (!boot->bpbRootDirEnts)
|
||||
boot->flags |= FAT32;
|
||||
if (boot->flags & FAT32) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue