summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2008-07-14 13:29:45 +0000
committerhenning <henning@openbsd.org>2008-07-14 13:29:45 +0000
commiteac62a9a83a19093fc40ce9927bf5c4b77db7e46 (patch)
tree18daa59a2ac843010b52eca7660df432fd851d3b
parentZap some dead commons that are no longer used. (diff)
downloadwireguard-openbsd-eac62a9a83a19093fc40ce9927bf5c4b77db7e46.tar.xz
wireguard-openbsd-eac62a9a83a19093fc40ce9927bf5c4b77db7e46.zip
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
-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)