Do not allocate zero-length mbuf in sosend_generic().

Found by:	pho
Sponsored by:	Nginx, Inc.
This commit is contained in:
Gleb Smirnoff 2014-11-19 14:27:38 +00:00
parent dc61566f95
commit 67af272bcf

View File

@ -1310,7 +1310,7 @@ restart:
resid = 0; resid = 0;
if (flags & MSG_EOR) if (flags & MSG_EOR)
top->m_flags |= M_EOR; top->m_flags |= M_EOR;
} else { } else if (resid > 0) {
/* /*
* Copy the data from userland into a mbuf * Copy the data from userland into a mbuf
* chain. If no data is to be copied in, * chain. If no data is to be copied in,