]> Git Repo - qemu.git/commitdiff
net: make iov_to_buf take right size argument in nc_sendv_compat()
authorYang Hongyang <[email protected]>
Tue, 20 Oct 2015 01:51:25 +0000 (09:51 +0800)
committerJason Wang <[email protected]>
Tue, 27 Oct 2015 02:30:40 +0000 (10:30 +0800)
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 <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Signed-off-by: Jason Wang <[email protected]>
net/net.c

index 70a3576db9bde219088226df263065bf7978540f..2f2b39e09b4ce2761a5a3a672ff5ea7762dd6ea1 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -708,7 +708,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) {
This page took 0.026931 seconds and 4 git commands to generate.