diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-10-25 09:24:15 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-10-25 09:24:30 -0400 |
commit | 52a82bc53c82c82f754c1267aaa68b48737ba07c (patch) | |
tree | d26a3af14031f7507e3c6a273aaf8a342d8001e0 /src | |
parent | 76da5f8b807bfad1763e6ce3ac6dfba3725c9c13 (diff) | |
download | tor-52a82bc53c82c82f754c1267aaa68b48737ba07c.tar.gz tor-52a82bc53c82c82f754c1267aaa68b48737ba07c.zip |
Add a couple more checks to test_parsecommon.c
These checks should make coverity stop giving us a "dereference
before null check" warning here.
Diffstat (limited to 'src')
-rw-r--r-- | src/test/test_parsecommon.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/test_parsecommon.c b/src/test/test_parsecommon.c index 7ce4b71b00..6da125dd0a 100644 --- a/src/test/test_parsecommon.c +++ b/src/test/test_parsecommon.c @@ -295,6 +295,7 @@ test_parsecommon_get_next_token_parse_keys(void *arg) token_rule_t rule = T1("onion-key", R_IPO_ONION_KEY, NO_ARGS, NEED_KEY_1024); token = get_next_token(area, s, end, &rule); + tt_assert(token); tt_int_op(token->tp, OP_EQ, R_IPO_ONION_KEY); tt_int_op(token->n_args, OP_EQ, 0); @@ -329,6 +330,7 @@ test_parsecommon_get_next_token_parse_keys(void *arg) NEED_SKEY_1024); token2 = get_next_token(area, s2, end2, &rule2); + tt_assert(token2); tt_int_op(token2->tp, OP_EQ, C_CLIENT_KEY); tt_int_op(token2->n_args, OP_EQ, 0); @@ -590,4 +592,3 @@ struct testcase_t parsecommon_tests[] = { PARSECOMMON_TEST(get_next_token_err_bad_base64), END_OF_TESTCASES }; - |