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:
Sam Leffler 2005-03-28 18:51:58 +00:00
parent 4af77ece56
commit bd1da15f2a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144246

View File

@ -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;
}
/*