From dd3f00cbaf11542cacc58ea873ca1adc7c5da2cc Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Wed, 4 May 2016 22:27:22 +0000 Subject: [PATCH] fsck_msdosfs: Adjust a check. The on-disk FAT array does not include anything before CLUST_FIRST, compensate in size check. Obtained from: NetBSD (CVS Rev. 1.20) MFC after: 2 weeks --- sbin/fsck_msdosfs/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/fsck_msdosfs/boot.c b/sbin/fsck_msdosfs/boot.c index b1760c5c02d..667af93a86e 100644 --- a/sbin/fsck_msdosfs/boot.c +++ b/sbin/fsck_msdosfs/boot.c @@ -221,7 +221,7 @@ readboot(int dosfs, struct bootblock *boot) break; } - if (boot->NumFatEntries < boot->NumClusters) { + if (boot->NumFatEntries < boot->NumClusters - CLUST_FIRST) { pfatal("FAT size too small, %u entries won't fit into %u sectors\n", boot->NumClusters, boot->FATsecs); return FSFATAL;