summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2005-05-17 21:43:09 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2005-05-17 21:43:09 +0000
commitb9388e2692235a7261753f69f4daedb12a4ff08b (patch)
tree106b18dc653db1e77a4ab4de31e25440e2802156
parentbe4d2c9de782c0f06d7f61d695a444c09232ee5d (diff)
under some circunstances, unp_scan() can call unp_mark() with a null pointer,
so check fp before dereferencing it; fixes a crash found by hshoexer@ with input from art@, art@ millert@ deraadt@ ok.
-rw-r--r--sys/kern/uipc_usrreq.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index e0296512069..d3973fadb68 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_usrreq.c,v 1.28 2004/07/22 06:13:08 tedu Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.29 2005/05/17 21:43:08 fgsch Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
@@ -973,6 +973,8 @@ void
unp_mark(fp)
struct file *fp;
{
+ if (fp == NULL)
+ return;
if (fp->f_flag & FMARK)
return;