summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-07-20 16:48:08 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-07-20 16:48:08 +0000
commita5de94375564303e90689b35a265cc0990816652 (patch)
treed15f58527721057aa18170970848fde6fb90642c /sys/kern
parent89892fb380e093504571203e198d86877a83ae3d (diff)
Don't try to dereference fp if it is NULL, ok deraadt
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_tame.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/kern_tame.c b/sys/kern/kern_tame.c
index 84f629a00c7..f590ce07d5b 100644
--- a/sys/kern/kern_tame.c
+++ b/sys/kern/kern_tame.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_tame.c,v 1.6 2015/07/20 16:15:40 nicm Exp $ */
+/* $OpenBSD: kern_tame.c,v 1.7 2015/07/20 16:48:07 nicm Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -679,11 +679,14 @@ int
tame_ioctl_check(struct proc *p, long com, void *v)
{
struct file *fp = v;
- struct vnode *vp = (struct vnode *)fp->f_data;
+ struct vnode *vp = NULL;
if ((p->p_p->ps_flags & PS_TAMED) == 0)
return (0);
+ if (fp != NULL)
+ vp = (struct vnode *)fp->f_data;
+
switch (com) {
/*