From eac62a9a83a19093fc40ce9927bf5c4b77db7e46 Mon Sep 17 00:00:00 2001 From: henning Date: Mon, 14 Jul 2008 13:29:45 +0000 Subject: [PATCH] m_copy can return NULL, so check for it problem found by "Adrian M. Whatley" and "Stephan A. Rickauer" , both @ni.phys.ethz.ch fix by me, ok mpf --- sys/net/pf.c | 6 ++++-- 1 file 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) -- 2.20.1