Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/fsck_msdos The on-disk FAT array does not include anyth...



details:   https://anonhg.NetBSD.org/src/rev/3ca43fc71aae
branches:  trunk
changeset: 345016:3ca43fc71aae
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Mon May 02 17:33:03 2016 +0000

description:
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.

diffstat:

 sbin/fsck_msdos/boot.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r ce5844926de9 -r 3ca43fc71aae sbin/fsck_msdos/boot.c
--- a/sbin/fsck_msdos/boot.c    Mon May 02 17:24:06 2016 +0000
+++ b/sbin/fsck_msdos/boot.c    Mon May 02 17:33:03 2016 +0000
@@ -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 @@
                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;



Home | Main Index | Thread Index | Old Index