[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/main] test_hs_ob: initialize pointers to NULL



commit a11a9bb3a0ebdba5c4a283012cc35d5077ee796c
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Mon Jul 12 14:59:29 2021 -0400

    test_hs_ob: initialize pointers to NULL
    
    This is an attempt to fix CID 1486280, where coverity warns us that,
    if the tests failed, we might free() an uninitialized pointer.
---
 src/test/test_hs_ob.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_hs_ob.c b/src/test/test_hs_ob.c
index 3485655c2e..2f69bf31e0 100644
--- a/src/test/test_hs_ob.c
+++ b/src/test/test_hs_ob.c
@@ -174,6 +174,7 @@ test_get_subcredentials(void *arg)
   hs_subcredential_t *subcreds = NULL;
 
   (void) arg;
+  memset(&config, 0, sizeof(config));
 
   MOCK(networkstatus_get_live_consensus,
        mock_networkstatus_get_live_consensus);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits