Bug 1439236: exit early if m_copym gets called with null ptr r=dminor

Cheery-picked upstream commit:
d89882d049

MozReview-Commit-ID: 36bYbfIaqEz

--HG--
extra : rebase_source : 334b13ec00e9d82346a2c6ebfdadaf87b6161406
This commit is contained in:
Nils Ohlmeier [:drno] 2018-05-16 09:51:35 -07:00
Родитель 68d7eca9b0
Коммит bf1ee00dc5
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -987,6 +987,13 @@ m_copym(struct mbuf *m, int off0, int len, int wait)
KASSERT(off >= 0, ("m_copym, negative off %d", off));
KASSERT(len >= 0, ("m_copym, negative len %d", len));
KASSERT(m != NULL, ("m_copym, m is NULL"));
#if !defined(INVARIANTS)
if (m == NULL) {
return (NULL);
}
#endif
if (off == 0 && m->m_flags & M_PKTHDR)
copyhdr = 1;