Module Name: src
Committed By: jakllsch
Date: Mon May 2 17:33:04 UTC 2016
Modified Files:
src/sbin/fsck_msdos: boot.c
Log Message:
The on-disk FAT array does not include anything before CLUST_FIRST,
compensate in size check.
This was tickled by my SanDisk Sansa Clip 4GB, which exactly filled the FAT
array.
To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sbin/fsck_msdos/boot.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/fsck_msdos/boot.c
diff -u src/sbin/fsck_msdos/boot.c:1.19 src/sbin/fsck_msdos/boot.c:1.20
--- src/sbin/fsck_msdos/boot.c:1.19 Fri Jan 2 06:21:28 2015
+++ src/sbin/fsck_msdos/boot.c Mon May 2 17:33:03 2016
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: boot.c,v 1.19 2015/01/02 06:21:28 mlelstv Exp $");
+__RCSID("$NetBSD: boot.c,v 1.20 2016/05/02 17:33:03 jakllsch Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -237,7 +237,7 @@ readboot(int dosfs, struct bootblock *bo
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;