Received: from eggs.gnu.org ([2001:4830:134:3::10]:53980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoM5s-0000vQ-5C for qemu-devel@nongnu.org; Mon, 19 Oct 2015 21:52:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoM5n-0001Ng-I9 for qemu-devel@nongnu.org; Mon, 19 Oct 2015 21:52:04 -0400 Received: from [59.151.112.132] (port=7052 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoM5n-0001KP-5q for qemu-devel@nongnu.org; Mon, 19 Oct 2015 21:51:59 -0400 From: Yang Hongyang Date: Tue, 20 Oct 2015 09:51:25 +0800 Message-ID: <1445305886-11901-1-git-send-email-yanghy@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH 1/2] net: make iov_to_buf take right size argument in nc_sendv_compat() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Jason Wang , Yang Hongyang We want "buf, sizeof(buf)" here. sizeof(buffer) is the size of a pointer, which is wrong. Thanks to Paolo for pointing it out. Signed-off-by: Yang Hongyang Cc: Jason Wang Cc: Paolo Bonzini --- net/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/net.c b/net/net.c index 39af893..0c4a012 100644 --- a/net/net.c +++ b/net/net.c @@ -700,7 +700,7 @@ static ssize_t nc_sendv_compat(NetClientState *nc, const struct iovec *iov, offset = iov[0].iov_len; } else { buffer = buf; - offset = iov_to_buf(iov, iovcnt, 0, buffer, sizeof(buffer)); + offset = iov_to_buf(iov, iovcnt, 0, buf, sizeof(buf)); } if (flags & QEMU_NET_PACKET_FLAG_RAW && nc->info->receive_raw) { -- 1.9.1