summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2008-07-23 11:53:08 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2008-07-23 11:53:08 +0000
commit09d6f954b1323e32b716a1c7ff880f4bd85bac88 (patch)
treed4cb14faa02ece38a259e445d5d71478a7170ebd /sys
parent23563b0df957c5d245537371af4407377047ce74 (diff)
- 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
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/nfs_vnops.c5
1 files changed, 3 insertions, 2 deletions
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) {