Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/msdosfs Check that the FSInfo block's next free clust...



details:   https://anonhg.NetBSD.org/src/rev/f72326f72152
branches:  trunk
changeset: 782492:f72326f72152
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Nov 04 17:18:56 2012 +0000

description:
Check that the FSInfo block's next free cluster suggestion is actually
a cluster within the bounds of the volume too.

diffstat:

 sys/fs/msdosfs/msdosfs_vfsops.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 1007a7749b5e -r f72326f72152 sys/fs/msdosfs/msdosfs_vfsops.c
--- a/sys/fs/msdosfs/msdosfs_vfsops.c   Sun Nov 04 17:16:37 2012 +0000
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c   Sun Nov 04 17:18:56 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_vfsops.c,v 1.98 2012/11/04 17:16:37 jakllsch Exp $     */
+/*     $NetBSD: msdosfs_vfsops.c,v 1.99 2012/11/04 17:18:56 jakllsch Exp $     */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.98 2012/11/04 17:16:37 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.99 2012/11/04 17:18:56 jakllsch Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -763,7 +763,8 @@
         * XXX
         */
        if (pmp->pm_fsinfo) {
-               if (pmp->pm_nxtfree == 0xffffffffUL)
+               if ((pmp->pm_nxtfree == 0xffffffffUL) ||
+                   (pmp->pm_nxtfree > pmp->pm_maxcluster))
                        pmp->pm_fsinfo = 0;
        }
 



Home | Main Index | Thread Index | Old Index