Browse Source

virtfs-proxy-helper: fix call to accept

The current code calls accept() without initializing the size parameter
which means the accept call might write too much to the stack.

URL: https://bugs.gentoo.org/486714
Signed-off-by: Tim Comer <comer0@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Tim Comer 11 years ago
parent
commit
b0f9300ca3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      fsdev/virtfs-proxy-helper.c

+ 1 - 0
fsdev/virtfs-proxy-helper.c

@@ -760,6 +760,7 @@ static int proxy_socket(const char *path, uid_t uid, gid_t gid)
         return -1;
     }
 
+    size = sizeof(qemu);
     client = accept(sock, (struct sockaddr *)&qemu, &size);
     if (client < 0) {
         do_perror("accept");