summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kurz2021-01-11 10:49:56 +0100
committerGreg Kurz2021-01-21 17:49:45 +0100
commitacef3f8b47060f05e13de5b615268c39b274aab0 (patch)
tree2fdf6504322ef3b22bf73aa890358e77e5bca936
parentMerge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2021-01-20' into st... (diff)
downloadqemu-acef3f8b47060f05e13de5b615268c39b274aab0.tar.gz
qemu-acef3f8b47060f05e13de5b615268c39b274aab0.tar.xz
qemu-acef3f8b47060f05e13de5b615268c39b274aab0.zip
9pfs/proxy: Check return value of proxy_marshal()
This should always successfully write exactly two 32-bit integers. Make it clear with an assert(), like v9fs_receive_status() and v9fs_receive_response() already do when unmarshalling the same header. Fixes: Coverity CID 1438968 Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <161035859647.1221144.4691749806675653934.stgit@bahia.lan> Signed-off-by: Greg Kurz <groug@kaod.org>
-rw-r--r--hw/9pfs/9p-proxy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c
index 6f598a0f11..4aa4e0a3ba 100644
--- a/hw/9pfs/9p-proxy.c
+++ b/hw/9pfs/9p-proxy.c
@@ -537,7 +537,8 @@ static int v9fs_request(V9fsProxy *proxy, int type, void *response, ...)
}
/* marshal the header details */
- proxy_marshal(iovec, 0, "dd", header.type, header.size);
+ retval = proxy_marshal(iovec, 0, "dd", header.type, header.size);
+ assert(retval == 4 * 2);
header.size += PROXY_HDR_SZ;
retval = qemu_write_full(proxy->sockfd, iovec->iov_base, header.size);