[Midnightbsd-cvs] src [12255] trunk/sys/kern/uipc_mbuf2.c: Due do a missing check in the code of m_pulldown(9) data returned may not be

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Aug 21 09:20:13 EDT 2019


Revision: 12255
          http://svnweb.midnightbsd.org/src/?rev=12255
Author:   laffer1
Date:     2019-08-21 09:20:12 -0400 (Wed, 21 Aug 2019)
Log Message:
-----------
Due do a missing check in the code of m_pulldown(9) data returned may not be
contiguous as requested by the caller.

Modified Paths:
--------------
    trunk/sys/kern/uipc_mbuf2.c

Modified: trunk/sys/kern/uipc_mbuf2.c
===================================================================
--- trunk/sys/kern/uipc_mbuf2.c	2019-08-18 19:35:40 UTC (rev 12254)
+++ trunk/sys/kern/uipc_mbuf2.c	2019-08-21 13:20:12 UTC (rev 12255)
@@ -217,7 +217,7 @@
 		goto ok;
 	}
 	if ((off == 0 || offp) && M_LEADINGSPACE(n->m_next) >= hlen
-	 && writable) {
+	 && writable && n->m_next->m_len >= tlen) {
 		n->m_next->m_data -= hlen;
 		n->m_next->m_len += hlen;
 		bcopy(mtod(n, caddr_t) + off, mtod(n->m_next, caddr_t), hlen);



More information about the Midnightbsd-cvs mailing list