From: art Date: Wed, 23 Jul 2008 11:53:07 +0000 (+0000) Subject: - in nfs_mknodrpc - initialize the node we pass to nfs_lookitup. It's X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f58988bd16af7f9a575d857b75fb83a18e8993d0;p=openbsd - in nfs_mknodrpc - initialize the node we pass to nfs_lookitup. It's not just a return value, nfs_lookitup treats it specially when *npp is not NULL. - nfs_lookitup - When we match the file handle to the directory filehandle (lookup on '.'), initialize np so that we don't return stack garbage to the caller. The function shouldn't ever be called with '.' at this moment, but that's no reason to not do the right thing in case future callers use it that way. blambert@ thib@ ok --- diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index f6eb3a7ae0f..2741ca34473 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vnops.c,v 1.94 2008/07/06 16:54:48 thib Exp $ */ +/* $OpenBSD: nfs_vnops.c,v 1.95 2008/07/23 11:53:07 art Exp $ */ /* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */ /* @@ -1154,7 +1154,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap) u_int32_t *tl; int32_t t1; struct vnode *newvp = (struct vnode *)0; - struct nfsnode *np; + struct nfsnode *np = NULL; char *cp2; caddr_t dpos; int error = 0, wccflag = NFSV3_WCCRATTR, gotvp = 0; @@ -2523,6 +2523,7 @@ nfs_lookitup(dvp, name, len, cred, procp, npp) } else if (NFS_CMPFH(dnp, nfhp, fhlen)) { VREF(dvp); newvp = dvp; + np = dnp; } else { error = nfs_nget(dvp->v_mount, nfhp, fhlen, &np); if (error) {