From da6f24435662a801637ad917965a96791558e942 Mon Sep 17 00:00:00 2001 From: jakllsch Date: Tue, 7 Aug 2012 19:30:41 +0000 Subject: [PATCH] The free space value in the FSInfo block is merely unitialized when it is 0xffffffff. Fixes first part of bin/46743 --- sbin/fsck_msdos/fat.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sbin/fsck_msdos/fat.c b/sbin/fsck_msdos/fat.c index 2a0b7966f280..aa7c6247f9bf 100644 --- a/sbin/fsck_msdos/fat.c +++ b/sbin/fsck_msdos/fat.c @@ -1,4 +1,4 @@ -/* $NetBSD: fat.c,v 1.22 2009/04/11 07:14:50 lukem Exp $ */ +/* $NetBSD: fat.c,v 1.23 2012/08/07 19:30:41 jakllsch Exp $ */ /* * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank @@ -28,7 +28,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fat.c,v 1.22 2009/04/11 07:14:50 lukem Exp $"); +__RCSID("$NetBSD: fat.c,v 1.23 2012/08/07 19:30:41 jakllsch Exp $"); #endif /* not lint */ #include @@ -596,8 +596,9 @@ checklost(int dosfs, struct bootblock *boot, struct fatEntry *fat) if (boot->FSInfo) { ret = 0; - if (boot->FSFree != boot->NumFree) { - pwarn("Free space in FSInfo block (%d) not correct (%d)\n", + if (boot->FSFree != 0xffffffffU && + boot->FSFree != boot->NumFree) { + pwarn("Free space in FSInfo block (%u) not correct (%u)\n", boot->FSFree, boot->NumFree); if (ask(1, "fix")) { boot->FSFree = boot->NumFree;