diff options
author | archie <archie@FreeBSD.org> | 1999-11-08 03:11:22 +0000 |
---|---|---|
committer | archie <archie@FreeBSD.org> | 1999-11-08 03:11:22 +0000 |
commit | 2f772ace57a1b77273ed06935a57cb79ab89b02a (patch) | |
tree | a970f4bae04d588ad6f046d5816b64dd479ab3ff /sys/netgraph/ng_tee.c | |
parent | 4336de9993991afb8b7bcd10a20d98ce83b86fe6 (diff) | |
download | FreeBSD-src-2f772ace57a1b77273ed06935a57cb79ab89b02a.zip FreeBSD-src-2f772ace57a1b77273ed06935a57cb79ab89b02a.tar.gz |
Fix crash when trying to duplicate a NULL meta.
Diffstat (limited to 'sys/netgraph/ng_tee.c')
-rw-r--r-- | sys/netgraph/ng_tee.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/netgraph/ng_tee.c b/sys/netgraph/ng_tee.c index 8874e49..7ae417c 100644 --- a/sys/netgraph/ng_tee.c +++ b/sys/netgraph/ng_tee.c @@ -266,15 +266,18 @@ ngt_rcvdata(hook_p hook, struct mbuf *m, meta_p meta) } /* Copy meta info */ - MALLOC(meta2, meta_p, - meta->used_len, M_NETGRAPH, M_NOWAIT); - if (meta2 == NULL) { - m_freem(m2); - NG_FREE_DATA(m, meta); - return (ENOMEM); - } - meta2->allocated_len = meta->used_len; - bcopy(meta, meta2, meta->used_len); + if (meta != NULL) { + MALLOC(meta2, meta_p, + meta->used_len, M_NETGRAPH, M_NOWAIT); + if (meta2 == NULL) { + m_freem(m2); + NG_FREE_DATA(m, meta); + return (ENOMEM); + } + bcopy(meta, meta2, meta->used_len); + meta2->allocated_len = meta->used_len; + } else + meta2 = NULL; /* Deliver duplicate */ dup->stats.outOctets += m->m_pkthdr.len; |