summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2019-09-12 02:02:55 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2019-09-12 02:02:55 +0000
commit116bfb36c6ca520bed43460975014592125e3d1d (patch)
tree6a3f965f432b4cd6654c250e1092f2f77f86804f /sys/net
parent14a37fbdb2bbb396636c2508775087c0e8e2b3e0 (diff)
pf_test can return PF_PASS, but set the mbuf to NULL.
check for this like every other caller to pf_test so we don't go on to pass NULL to m_prepend. that causes a fault. chris@ gave me an excellent bug report. -msave-args is pretty great.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_tpmr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if_tpmr.c b/sys/net/if_tpmr.c
index 654a3d8e3fc..6af11933c40 100644
--- a/sys/net/if_tpmr.c
+++ b/sys/net/if_tpmr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tpmr.c,v 1.3 2019/08/05 03:56:31 dlg Exp $ */
+/* $OpenBSD: if_tpmr.c,v 1.4 2019/09/12 02:02:54 dlg Exp $ */
/*
* Copyright (c) 2019 The University of Queensland
@@ -263,6 +263,8 @@ tpmr_pf(struct ifnet *ifp0, int dir, struct mbuf *m)
m_freem(m);
return (NULL);
}
+ if (m == NULL)
+ return (NULL);
m = m_prepend(m, sizeof(*eh), M_DONTWAIT);
if (m == NULL)