summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2008-07-14 13:29:46 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2008-07-14 13:29:46 +0000
commitdba64875470cd16d0e8ef7ef8ef09766110a1114 (patch)
tree8b3db3b74b1c3f40e8a011fc932a505019187f55 /sys
parentcb0c7dbbe0bfd569629b288a0b42e1c688d95927 (diff)
m_copy can return NULL, so check for it
problem found by "Adrian M. Whatley" <amw> and "Stephan A. Rickauer" <stephan.rickauer>, both @ni.phys.ethz.ch fix by me, ok mpf
Diffstat (limited to 'sys')
-rw-r--r--sys/net/pf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index e21bf9f9f16..6afcea34723 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.609 2008/07/10 07:41:21 djm Exp $ */
+/* $OpenBSD: pf.c,v 1.610 2008/07/14 13:29:45 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1819,7 +1819,9 @@ pf_send_icmp(struct mbuf *m, u_int8_t type, u_int8_t code, sa_family_t af,
{
struct mbuf *m0;
- m0 = m_copy(m, 0, M_COPYALL);
+ if ((m0 = m_copy(m, 0, M_COPYALL)) == NULL)
+ return;
+
m0->m_pkthdr.pf.flags |= PF_TAG_GENERATED;
if (r->rtableid >= 0)