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

nickm at torproject.org nickm at torproject.org
Fri Jan 4 02:33:44 UTC 2019


commit ce3d501040fb994bb3c7dd82b21e02648621d3f1
Author: Nick Mathewson <nickm at torproject.org>
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);





More information about the tor-commits mailing list