Module Name:    src
Committed By:   jakllsch
Date:           Thu Jan 17 16:45:48 UTC 2013

Modified Files:
        src/sbin/fsck_msdos: fat.c

Log Message:
An uninitialized next-free-cluster value in the file system information
block is valid; do not consider it for correction.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sbin/fsck_msdos/fat.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/fat.c
diff -u src/sbin/fsck_msdos/fat.c:1.23 src/sbin/fsck_msdos/fat.c:1.24
--- src/sbin/fsck_msdos/fat.c:1.23	Tue Aug  7 19:30:41 2012
+++ src/sbin/fsck_msdos/fat.c	Thu Jan 17 16:45:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: fat.c,v 1.23 2012/08/07 19:30:41 jakllsch Exp $	*/
+/*	$NetBSD: fat.c,v 1.24 2013/01/17 16:45:48 jakllsch Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: fat.c,v 1.23 2012/08/07 19:30:41 jakllsch Exp $");
+__RCSID("$NetBSD: fat.c,v 1.24 2013/01/17 16:45:48 jakllsch Exp $");
 #endif /* not lint */
 
 #include <stdlib.h>
@@ -605,7 +605,9 @@ checklost(int dosfs, struct bootblock *b
 				ret = 1;
 			}
 		}
-		if (boot->FSNext >= boot->NumClusters || (boot->NumFree && fat[boot->FSNext].next != CLUST_FREE)) {
+		if (boot->FSNext != 0xffffffffU &&
+		    (boot->FSNext >= boot->NumClusters ||
+		    (boot->NumFree && fat[boot->FSNext].next != CLUST_FREE))) {
 			pwarn("Next free cluster in FSInfo block (%u) %s\n",
 			      boot->FSNext,
 			      (boot->FSNext >= boot->NumClusters) ? "invalid" : "not free");

Reply via email to