Author: glebius
Date: Wed Nov 19 14:27:38 2014
New Revision: 274712
URL: https://svnweb.freebsd.org/changeset/base/274712

Log:
  Do not allocate zero-length mbuf in sosend_generic().
  
  Found by:     pho
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c Wed Nov 19 14:23:29 2014        (r274711)
+++ head/sys/kern/uipc_socket.c Wed Nov 19 14:27:38 2014        (r274712)
@@ -1310,7 +1310,7 @@ restart:
                                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,
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to