summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1997-03-01 23:03:39 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1997-03-01 23:03:39 +0000
commitb6bfcd66d9e56c78e4150e208cabbe2b05e40cbd (patch)
tree2932dffa770b47b0551c9714b40507956468c853 /sys/kern
parent0d7e7e791f8519f6f1796ebbf983fb9fc148e3dc (diff)
Don't dereference a vnode pointer that is NULL
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_lookup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 7d3da31ddfa..217f0b273df 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_lookup.c,v 1.5 1996/11/06 06:51:45 tholo Exp $ */
+/* $OpenBSD: vfs_lookup.c,v 1.6 1997/03/01 23:03:38 tholo Exp $ */
/* $NetBSD: vfs_lookup.c,v 1.17 1996/02/09 19:00:59 christos Exp $ */
/*
@@ -181,7 +181,7 @@ namei(ndp)
/*
* Check for directory if dironly
*/
- if (dironly && ndp->ni_vp->v_type != VDIR) {
+ if (dironly && ndp->ni_vp != NULL && ndp->ni_vp->v_type != VDIR) {
if ((cnp->cn_flags & LOCKPARENT) && ndp->ni_pathlen == 1)
VOP_UNLOCK(ndp->ni_dvp);
vput(ndp->ni_vp);