[tor-commits] [tor/master] Add a redundant memset to node_get_pref_ipv6_orport()

nickm at torproject.org nickm at torproject.org
Tue Apr 17 23:46:33 UTC 2018


commit 31a450a5b69a88fd9f38b1ca043952009ffddbf7
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Apr 17 19:41:10 2018 -0400

    Add a redundant memset to node_get_pref_ipv6_orport()
    
    For whatever reason, clang's scan-build isn't sure that this
    function actually initializes its output.
---
 src/or/nodelist.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/or/nodelist.c b/src/or/nodelist.c
index 71eee3fa2..81a5c944a 100644
--- a/src/or/nodelist.c
+++ b/src/or/nodelist.c
@@ -1517,6 +1517,7 @@ node_get_pref_ipv6_orport(const node_t *node, tor_addr_port_t *ap_out)
 {
   node_assert_ok(node);
   tor_assert(ap_out);
+  memset(ap_out, 0, sizeof(*ap_out));
 
   /* Check ri first, because rewrite_node_address_for_bridge() updates
    * node->ri with the configured bridge address.





More information about the tor-commits mailing list