From f3990931c3d488ff08eb2e2f690107026a952d2f Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Wed, 28 Jun 2000 17:42:07 +0000 Subject: prevent endless looping on looping fat chains --- sbin/fsck_msdos/fat.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sbin/fsck_msdos') diff --git a/sbin/fsck_msdos/fat.c b/sbin/fsck_msdos/fat.c index 36b0c8d08c3..9ed3137ad52 100644 --- a/sbin/fsck_msdos/fat.c +++ b/sbin/fsck_msdos/fat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fat.c,v 1.8 1999/09/06 12:39:58 espie Exp $ */ +/* $OpenBSD: fat.c,v 1.9 2000/06/28 17:42:06 mickey Exp $ */ /* $NetBSD: fat.c,v 1.8 1997/10/17 11:19:53 ws Exp $ */ /* @@ -35,7 +35,7 @@ #ifndef lint -static char rcsid[] = "$OpenBSD: fat.c,v 1.8 1999/09/06 12:39:58 espie Exp $"; +static char rcsid[] = "$OpenBSD: fat.c,v 1.9 2000/06/28 17:42:06 mickey Exp $"; #endif /* not lint */ #include @@ -368,7 +368,8 @@ checkfat(boot, fat) /* follow the chain and mark all clusters on the way */ for (len = 0, p = head; - p >= CLUST_FIRST && p < boot->NumClusters; + p >= CLUST_FIRST && p < boot->NumClusters && + fat[p].head != head; p = fat[p].next) { fat[p].head = head; len++; -- cgit v1.2.3