Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Sep 2018 13:44:05 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338857 - head/sys/dev/ffec
Message-ID:  <201809211344.w8LDi5gh066014@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Fri Sep 21 13:44:05 2018
New Revision: 338857
URL: https://svnweb.freebsd.org/changeset/base/338857

Log:
  Fix possible NULL pointer dereference in ffec_alloc_mbufcl().
  
  PR:		231514
  Approved by:	re (kib)
  MFC after:	1 week

Modified:
  head/sys/dev/ffec/if_ffec.c

Modified: head/sys/dev/ffec/if_ffec.c
==============================================================================
--- head/sys/dev/ffec/if_ffec.c	Fri Sep 21 13:43:06 2018	(r338856)
+++ head/sys/dev/ffec/if_ffec.c	Fri Sep 21 13:44:05 2018	(r338857)
@@ -801,7 +801,8 @@ ffec_alloc_mbufcl(struct ffec_softc *sc)
 	struct mbuf *m;
 
 	m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
-	m->m_pkthdr.len = m->m_len = m->m_ext.ext_size;
+	if (m != NULL)
+		m->m_pkthdr.len = m->m_len = m->m_ext.ext_size;
 
 	return (m);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809211344.w8LDi5gh066014>