Browse Source

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.
Nick Mathewson 6 years ago
parent
commit
6b2e856122
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/test/test_hs_intropoint.c

+ 1 - 0
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));