avoid potential null ptr deref by free'ing excess mbufs instead of
zero'ing their length (copied from m_adj where this code came from after the equivalent change there has had time to soak) Noticed by: Coverity Prevent analysis tool
This commit is contained in:
parent
4af77ece56
commit
bd1da15f2a
@ -949,12 +949,14 @@ nfsm_adj(struct mbuf *mp, int len, int nul)
|
||||
for (i = 0; i < nul; i++)
|
||||
*cp++ = '\0';
|
||||
}
|
||||
if (m->m_next != NULL) {
|
||||
m_freem(m->m_next);
|
||||
m->m_next = NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
count -= m->m_len;
|
||||
}
|
||||
for (m = m->m_next;m;m = m->m_next)
|
||||
m->m_len = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user