Source-Changes-HG archive

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

[src/trunk]: src/sbin/fsck_msdos An uninitialized next-free-cluster value in ...



details:   https://anonhg.NetBSD.org/src/rev/efd55a5c9c48
branches:  trunk
changeset: 784074:efd55a5c9c48
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Thu Jan 17 16:45:48 2013 +0000

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

diffstat:

 sbin/fsck_msdos/fat.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 9acdc3c81f68 -r efd55a5c9c48 sbin/fsck_msdos/fat.c
--- a/sbin/fsck_msdos/fat.c     Thu Jan 17 16:29:44 2013 +0000
+++ b/sbin/fsck_msdos/fat.c     Thu Jan 17 16:45:48 2013 +0000
@@ -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 @@
                                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");



Home | Main Index | Thread Index | Old Index