Fix: pass a valid length to accept() on unix domain sockets
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 31 Aug 2016 03:00:57 +0000 (23:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 31 Aug 2016 03:00:57 +0000 (23:00 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/unix.c

index 0e94bbc2b42b39c8c375a33ce619d5a7b343a612..7bcbb688b7389f9eb2fccba4b50c7db58a67ee6e 100644 (file)
@@ -82,7 +82,7 @@ int lttcomm_accept_unix_sock(int sock)
 {
        int new_fd;
        struct sockaddr_un s_un;
-       socklen_t len = 0;
+       socklen_t len = sizeof(s_un);
 
        /* Blocking call */
        new_fd = accept(sock, (struct sockaddr *) &s_un, &len);
This page took 0.033838 seconds and 4 git commands to generate.