Source-Changes-HG archive

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

[src/trunk]: src/sys/kern don't store random values in retval



details:   https://anonhg.NetBSD.org/src/rev/5e2ed9e978d3
branches:  trunk
changeset: 787694:5e2ed9e978d3
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jun 28 15:32:20 2013 +0000

description:
don't store random values in retval
http://m00nbsd.net/ae123a9bae03f7dde5c6d654412daf5a.html

diffstat:

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

diffs (31 lines):

diff -r f4d096385086 -r 5e2ed9e978d3 sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Fri Jun 28 15:32:07 2013 +0000
+++ b/sys/kern/vfs_syscalls.c   Fri Jun 28 15:32:20 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls.c,v 1.463 2013/01/13 08:15:03 dholland Exp $      */
+/*     $NetBSD: vfs_syscalls.c,v 1.464 2013/06/28 15:32:20 christos Exp $      */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.463 2013/01/13 08:15:03 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.464 2013/06/28 15:32:20 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -3198,10 +3198,10 @@
                KASSERT(l == curlwp);
                auio.uio_vmspace = l->l_proc->p_vmspace;
                auio.uio_resid = count;
-               error = VOP_READLINK(vp, &auio, l->l_cred);
+               if ((error = VOP_READLINK(vp, &auio, l->l_cred)) == 0)
+                       *retval = count - auio.uio_resid;
        }
        vput(vp);
-       *retval = count - auio.uio_resid;
        return (error);
 }
 



Home | Main Index | Thread Index | Old Index