Просмотр исходного кода

Explicitly initialize addresses in tor_ersatz_socketpair

This should stop a false positive from the clangalyzer.
Nick Mathewson 9 лет назад
Родитель
Сommit
1a2f2c163f
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      src/common/compat.c

+ 3 - 0
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