diff --git a/sbin/fsck_msdosfs/boot.c b/sbin/fsck_msdosfs/boot.c index 9a954d07ae9e..9e0958a94544 100644 --- a/sbin/fsck_msdosfs/boot.c +++ b/sbin/fsck_msdosfs/boot.c @@ -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) {