Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Nov 2014 14:27:39 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r274712 - head/sys/kern
Message-ID:  <201411191427.sAJERdmf018424@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411191427.sAJERdmf018424>