mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
change m_adj to reclaim unused mbufs instead of zero'ing m_len
when trim'ing space off the back of a chain; this is indirect solution to a potential null ptr deref Noticed by: Coverity Prevent analysis tool (null ptr deref) Reviewed by: dg, rwatson
This commit is contained in:
parent
0fa17d320d
commit
59d8b31002
1 changed files with 4 additions and 2 deletions
|
|
@ -691,12 +691,14 @@ m_adj(struct mbuf *mp, int req_len)
|
|||
for (; m; m = m->m_next) {
|
||||
if (m->m_len >= count) {
|
||||
m->m_len = count;
|
||||
if (m->m_next != NULL) {
|
||||
m_freem(m->m_next);
|
||||
m->m_next = NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
count -= m->m_len;
|
||||
}
|
||||
while (m->m_next)
|
||||
(m = m->m_next) ->m_len = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue