diff --git a/sbin/fsck_msdos/fat.c b/sbin/fsck_msdos/fat.c index aa7c6247f9bf..9e4139d742d4 100644 --- a/sbin/fsck_msdos/fat.c +++ b/sbin/fsck_msdos/fat.c @@ -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 #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 @@ -605,7 +605,9 @@ checklost(int dosfs, struct bootblock *boot, struct fatEntry *fat) 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");