]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a (spurious) scan-build warning in test_introduce1_validation()
authorNick Mathewson <nickm@torproject.org>
Tue, 16 Jan 2018 13:36:34 +0000 (08:36 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 16 Jan 2018 13:36:34 +0000 (08:36 -0500)
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

index 6a7962b2128a9adc06cd7afb55b4e31d8868c198..66832087a0ad888f8de93d5f4e829b8d9d8d9574 100644 (file)
@@ -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));