]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
fix an already-existing bug in the unit tests
authorRoger Dingledine <arma@torproject.org>
Fri, 29 Oct 2021 19:24:43 +0000 (15:24 -0400)
committerRoger Dingledine <arma@torproject.org>
Mon, 8 Nov 2021 10:37:02 +0000 (05:37 -0500)
where the or_conn for testing the failure cache would be initialized
with random stack data, so e.g. its potentially_used_for_bootstrapping
field would start out at some random value.

src/test/test_connection.c

index 87940f71e6d7eabed5999961aba4a5b9c3bf8b39..fbf9d6a5ab938c67dea874016ec15a16e666472b 100644 (file)
@@ -826,6 +826,7 @@ test_failed_orconn_tracker(void *arg)
 
   /* Prepare the OR connection that will be used in this test */
   or_connection_t or_conn;
+  memset(&or_conn, 0, sizeof(or_conn));
   tt_int_op(AF_INET,OP_EQ, tor_addr_parse(&or_conn.canonical_orport.addr,
                                           "18.0.0.1"));
   tt_int_op(AF_INET,OP_EQ, tor_addr_parse(&or_conn.base_.addr, "18.0.0.1"));