diff options
author | mlaier <mlaier@FreeBSD.org> | 2006-01-14 22:19:17 +0000 |
---|---|---|
committer | mlaier <mlaier@FreeBSD.org> | 2006-01-14 22:19:17 +0000 |
commit | b96a262dce937736f368c85a0494cc08eab17fbb (patch) | |
tree | bcc20a7d026553627a7917a74f47d48c94d91dba /sys/contrib/pf | |
parent | 0b544658fc2f12b7d124a03d5b3e86c1f2b0b9a4 (diff) | |
download | FreeBSD-src-b96a262dce937736f368c85a0494cc08eab17fbb.zip FreeBSD-src-b96a262dce937736f368c85a0494cc08eab17fbb.tar.gz |
Move m_adj after checking that m_dup succeeded.
Found with: Coverity Prevent(tm)
MFC after: 3 days
Diffstat (limited to 'sys/contrib/pf')
-rw-r--r-- | sys/contrib/pf/net/pf_norm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/contrib/pf/net/pf_norm.c b/sys/contrib/pf/net/pf_norm.c index 7312ecd..36e210e 100644 --- a/sys/contrib/pf/net/pf_norm.c +++ b/sys/contrib/pf/net/pf_norm.c @@ -718,15 +718,16 @@ pf_fragcache(struct mbuf **m0, struct ip *h, struct pf_fragment **frag, int mff, */ #ifdef __FreeBSD__ *m0 = m_dup(m, M_DONTWAIT); - /* From KAME Project : We have missed this! */ - m_adj(*m0, (h->ip_hl << 2) - - (*m0)->m_pkthdr.len); #else *m0 = m_copym2(m, 0, h->ip_hl << 2, M_NOWAIT); #endif if (*m0 == NULL) goto no_mem; #ifdef __FreeBSD__ + /* From KAME Project : We have missed this! */ + m_adj(*m0, (h->ip_hl << 2) - + (*m0)->m_pkthdr.len); + KASSERT(((*m0)->m_next == NULL), ("(*m0)->m_next != NULL: %s", __FUNCTION__)); |