[tor-commits] [tor/master] Fix a (spurious) scan-build warning in test_introduce1_validation()

nickm at torproject.org nickm at torproject.org
Tue Jan 16 13:46:00 UTC 2018


commit 6b2e856122c7732b860ce128fcd93d7a71a76fb0
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Jan 16 08:36:34 2018 -0500

    Fix a (spurious) scan-build warning in test_introduce1_validation()
    
    Since helper_create_introduce1_cell() checks "cell" for nullness,
    scan-build is concerned that test_introduce1_validation()
    dereferences it without checking it.  So, add a check.
    
    Not backporting, since this is spurious, _and_ tests-only.
---
 src/test/test_hs_intropoint.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/test_hs_intropoint.c b/src/test/test_hs_intropoint.c
index 6a7962b21..66832087a 100644
--- a/src/test/test_hs_intropoint.c
+++ b/src/test/test_hs_intropoint.c
@@ -725,6 +725,7 @@ test_introduce1_validation(void *arg)
   /* Create our decoy cell that we'll modify as we go to test the validation
    * function of that parsed cell. */
   cell = helper_create_introduce1_cell();
+  tt_assert(cell);
 
   /* It should NOT be a legacy cell which will trigger a BUG(). */
   memset(cell->legacy_key_id, 'a', sizeof(cell->legacy_key_id));



More information about the tor-commits mailing list