Source-Changes-HG archive

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

[src/trunk]: src/sys/kern dostatvfs(): zero the statvfs structure before call...



details:   https://anonhg.NetBSD.org/src/rev/c7a9cb03c2f5
branches:  trunk
changeset: 569925:c7a9cb03c2f5
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Sep 13 20:02:20 2004 +0000

description:
dostatvfs(): zero the statvfs structure before calling filesystem code, so that
unset parts would have defined value and not pass random parts of kernel stack

diffstat:

 sys/kern/vfs_syscalls.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 7610c8eda04a -r c7a9cb03c2f5 sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Mon Sep 13 19:45:21 2004 +0000
+++ b/sys/kern/vfs_syscalls.c   Mon Sep 13 20:02:20 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls.c,v 1.210 2004/07/01 10:03:30 hannken Exp $       */
+/*     $NetBSD: vfs_syscalls.c,v 1.211 2004/09/13 20:02:20 jdolecek Exp $      */
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.210 2004/07/01 10:03:30 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.211 2004/09/13 20:02:20 jdolecek Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_43.h"
@@ -692,6 +692,8 @@
                goto done;
        }
 
+       /* Get the filesystem stats now */
+       memset(sp, 0, sizeof(*sp));
        if ((error = VFS_STATVFS(mp, sp, p)) != 0) {
                return error;
        }



Home | Main Index | Thread Index | Old Index