summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-09-30 02:31:05 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-09-30 02:31:05 +0000
commit08a990e0d4aba5bb5c2b912a5b516bd8de8a805f (patch)
treef141a96c9e29cb315755f785769319fd41ee5869
parentdb8ed2fb2ba89719a37f8b60d21820832e2ff75a (diff)
Check for NULL argument in bpf_mtap(). Some ethernet drivers
can call this with a NULL pointer, resulting in a panic. Matthias Scheler <tron@lyssa.owl.de>
-rw-r--r--sys/net/bpf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index f64776a88f6..d8fb4798ae1 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.11 1997/09/05 20:17:30 deraadt Exp $ */
+/* $OpenBSD: bpf.c,v 1.12 1997/09/30 02:31:04 millert Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
@@ -1118,6 +1118,9 @@ bpf_mtap(arg, m)
size_t pktlen, slen;
struct mbuf *m0;
+ if (m == NULL)
+ return;
+
pktlen = 0;
for (m0 = m; m0 != 0; m0 = m0->m_next)
pktlen += m0->m_len;