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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274712

View File

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