From 08a990e0d4aba5bb5c2b912a5b516bd8de8a805f Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 30 Sep 1997 02:31:05 +0000 Subject: Check for NULL argument in bpf_mtap(). Some ethernet drivers can call this with a NULL pointer, resulting in a panic. Matthias Scheler --- sys/net/bpf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3