summary refs log tree commit diff stats
path: root/fsdev/virtfs-proxy-helper.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-03-16 13:04:08 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-03-16 13:04:09 +0000
commit307146cb9359ad6d4544e00af073088772d165eb (patch)
treed797e5c1f8709d578863cebc8f191631ea2a2c5c /fsdev/virtfs-proxy-helper.c
parent2dfe7d07e2f40adb18a0b0cd286f3d327692d0fc (diff)
parent4ed7b2c3a78f785a1bcbe575e08c379b166723e3 (diff)
downloadfocaccia-qemu-307146cb9359ad6d4544e00af073088772d165eb.tar.gz
focaccia-qemu-307146cb9359ad6d4544e00af073088772d165eb.zip
Merge remote-tracking branch 'remotes/kvaneesh/for-upstream' into staging
* remotes/kvaneesh/for-upstream:
  virtio: Fix memory leaks reported by Coverity
  virtfs-proxy: Fix possible overflow
  fsdev/virtfs-proxy-helper: Fix improper use of negative value
  hw/9pfs/virtio-9p-posix-acl: Fix out-of-bounds access
  9pfs-proxy: tiny cleanups in proxy_pwritev and proxy_preadv
  9pfs-local: simplify/optimize local_mapped_attr_path()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'fsdev/virtfs-proxy-helper.c')
-rw-r--r--fsdev/virtfs-proxy-helper.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
index c1da2d78e7..13fe032543 100644
--- a/fsdev/virtfs-proxy-helper.c
+++ b/fsdev/virtfs-proxy-helper.c
@@ -262,6 +262,9 @@ static int send_status(int sockfd, struct iovec *iovec, int status)
      */
     msg_size = proxy_marshal(iovec, 0, "ddd", header.type,
                              header.size, status);
+    if (msg_size < 0) {
+        return msg_size;
+    }
     retval = socket_write(sockfd, iovec->iov_base, msg_size);
     if (retval < 0) {
         return retval;
@@ -735,6 +738,7 @@ static int proxy_socket(const char *path, uid_t uid, gid_t gid)
         return -1;
     }
 
+    g_assert(strlen(path) < sizeof(proxy.sun_path));
     sock = socket(AF_UNIX, SOCK_STREAM, 0);
     if (sock < 0) {
         do_perror("socket");