From a5de94375564303e90689b35a265cc0990816652 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Mon, 20 Jul 2015 16:48:08 +0000 Subject: Don't try to dereference fp if it is NULL, ok deraadt --- sys/kern/kern_tame.c | 7 +++++-- 1 file 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 @@ -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) { /* -- cgit v1.2.3