]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Explicitly initialize addresses in tor_ersatz_socketpair
authorNick Mathewson <nickm@torproject.org>
Tue, 2 Sep 2014 16:58:32 +0000 (12:58 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 2 Sep 2014 16:58:32 +0000 (12:58 -0400)
This should stop a false positive from the clangalyzer.

src/common/compat.c

index 278e5c5241b610398dacf9097a54ed9510878966..ad627f13f3c21cedb5d3c7d19f82626954870f01 100644 (file)
@@ -1435,6 +1435,9 @@ tor_ersatz_socketpair(int family, int type, int protocol, tor_socket_t fd[2])
     socklen_t size;
     int saved_errno = -1;
 
+    memset(&connect_addr, 0, sizeof(connect_addr));
+    memset(&listen_addr, 0, sizeof(listen_addr));
+
     if (protocol
 #ifdef AF_UNIX
         || family != AF_UNIX