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

Found by:	pho
Sponsored by:	Nginx, Inc.
This commit is contained in:
glebius 2014-11-19 14:27:38 +00:00
parent aee9f2a5a3
commit 79b6f9c70a

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,