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.
This commit is contained in:
Nick Mathewson 2018-01-16 08:36:34 -05:00
parent a86324d1fa
commit 6b2e856122

View 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 /* Create our decoy cell that we'll modify as we go to test the validation
* function of that parsed cell. */ * function of that parsed cell. */
cell = helper_create_introduce1_cell(); cell = helper_create_introduce1_cell();
tt_assert(cell);
/* It should NOT be a legacy cell which will trigger a BUG(). */ /* It should NOT be a legacy cell which will trigger a BUG(). */
memset(cell->legacy_key_id, 'a', sizeof(cell->legacy_key_id)); memset(cell->legacy_key_id, 'a', sizeof(cell->legacy_key_id));