[tor-commits] [tor/master] Explicitly initialize addresses in tor_ersatz_socketpair

nickm at torproject.org nickm at torproject.org
Tue Sep 2 19:42:08 UTC 2014


commit 1a2f2c163f68f888e45908e6493a273eb48b6236
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Sep 2 12:58:32 2014 -0400

    Explicitly initialize addresses in tor_ersatz_socketpair
    
    This should stop a false positive from the clangalyzer.
---
 src/common/compat.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/common/compat.c b/src/common/compat.c
index 278e5c5..ad627f13 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -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





More information about the tor-commits mailing list