diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-10-21 16:01:29 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-10-21 16:01:29 -0400 |
commit | 5e9f2384cf0f97646d7ee1b9eccaab4dfe382536 (patch) | |
tree | 3dfcc13eca3649fc3a9a55cc915f1e7fb1f6fecc /src/test/test_rendcache.c | |
parent | bebf6c6c676e9d8df73743b2619bda23a59c54df (diff) | |
download | tor-5e9f2384cf0f97646d7ee1b9eccaab4dfe382536.tar.gz tor-5e9f2384cf0f97646d7ee1b9eccaab4dfe382536.zip |
Fix various coverity-found issues
Diffstat (limited to 'src/test/test_rendcache.c')
-rw-r--r-- | src/test/test_rendcache.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/test_rendcache.c b/src/test/test_rendcache.c index dda527f214..11f11147cb 100644 --- a/src/test/test_rendcache.c +++ b/src/test/test_rendcache.c @@ -30,8 +30,8 @@ mock_rend_data(const char *onion_address) { rend_data_t *rend_query = tor_malloc_zero(sizeof(rend_data_t)); - strncpy(rend_query->onion_address, onion_address, - REND_SERVICE_ID_LEN_BASE32+1); + strlcpy(rend_query->onion_address, onion_address, + sizeof(rend_query->onion_address)); rend_query->auth_type = REND_NO_AUTH; rend_query->hsdirs_fp = smartlist_new(); smartlist_add(rend_query->hsdirs_fp, tor_memdup("aaaaaaaaaaaaaaaaaaaaaaaa", @@ -1041,7 +1041,7 @@ test_rend_cache_purge(void *data) rend_cache_purge(); tt_assert(rend_cache); tt_assert(strmap_size(rend_cache) == 0); - tt_assert(rend_cache != our_rend_cache); + tt_assert(rend_cache == our_rend_cache); done: rend_cache_free_all(); @@ -1244,6 +1244,7 @@ test_rend_cache_failure_purge(void *data) rend_cache_failure_purge(); + tt_ptr_op(rend_cache_failure, OP_NE, NULL); tt_int_op(strmap_size(rend_cache_failure), OP_EQ, 0); done: |