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

[tor-commits] [tor/master] Fix null-pointer-deref warning from scan-build in test_hs_service.c



commit ce3d501040fb994bb3c7dd82b21e02648621d3f1
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Mon Dec 17 09:28:24 2018 -0500

    Fix null-pointer-deref warning from scan-build in test_hs_service.c
---
 src/test/test_hs_service.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/test/test_hs_service.c b/src/test/test_hs_service.c
index 79cbd2e5d..b2aafc1cd 100644
--- a/src/test/test_hs_service.c
+++ b/src/test/test_hs_service.c
@@ -1654,6 +1654,9 @@ test_build_descriptors(void *arg)
     service->desc_current = NULL;
 
     build_all_descriptors(now);
+    tt_assert(service->desc_current);
+    tt_assert(service->desc_current->desc);
+
     hs_desc_superencrypted_data_t *superencrypted;
     superencrypted = &service->desc_current->desc->superencrypted_data;
     tt_int_op(smartlist_len(superencrypted->clients), OP_EQ, 16);



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