Fix crash when trying to duplicate a NULL meta.
This commit is contained in:
parent
a8e9726dfd
commit
3a0d1d886a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52977
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user