summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_fw.c
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2001-01-27 02:31:08 +0000
committerluigi <luigi@FreeBSD.org>2001-01-27 02:31:08 +0000
commit2ce587262d31ff02689f731abb38709909077e0c (patch)
treeed3dba150d4999d76049942f06abf726234504a1 /sys/netinet/ip_fw.c
parentb6baa60b1e807d09641c20b2ff1fe838ddebbd3b (diff)
downloadFreeBSD-src-2ce587262d31ff02689f731abb38709909077e0c.zip
FreeBSD-src-2ce587262d31ff02689f731abb38709909077e0c.tar.gz
Make sure we do not follow an invalid pointer in ipfw_report
when we get an incomplete packet or m_pullup fails.
Diffstat (limited to 'sys/netinet/ip_fw.c')
-rw-r--r--sys/netinet/ip_fw.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c
index 5e3cc1c..ca112d5 100644
--- a/sys/netinet/ip_fw.c
+++ b/sys/netinet/ip_fw.c
@@ -972,6 +972,7 @@ ip_fw_chk(struct ip **pip, int hlen,
#define PULLUP_TO(len) do { \
if ((*m)->m_len < (len)) { \
+ ip = NULL ; \
if ((*m = m_pullup(*m, (len))) == 0) \
goto bogusfrag; \
ip = mtod(*m, struct ip *); \
@@ -1310,7 +1311,7 @@ check_ports:
break;
bogusfrag:
- if (fw_verbose)
+ if (fw_verbose && ip != NULL)
ipfw_report(NULL, ip, offset, rif, oif);
goto dropit;
OpenPOWER on IntegriCloud