diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-08-29 15:09:27 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-08-29 15:09:27 -0400 |
commit | 573d62748ab2cacfdbba5ea04e855d56708d34e8 (patch) | |
tree | b9974d39f1b0ab35c8f8a0ec38353b84fc4e1170 /src/test/test_routerset.c | |
parent | c887e20e6a5a2c17c65f308e70e578e773b2ab23 (diff) | |
download | tor-573d62748ab2cacfdbba5ea04e855d56708d34e8.tar.gz tor-573d62748ab2cacfdbba5ea04e855d56708d34e8.zip |
Fix some coverity warnings in new routerset tests
Diffstat (limited to 'src/test/test_routerset.c')
-rw-r--r-- | src/test/test_routerset.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/test_routerset.c b/src/test/test_routerset.c index d6bdd1a0a4..9e5b51ee13 100644 --- a/src/test/test_routerset.c +++ b/src/test/test_routerset.c @@ -443,7 +443,7 @@ NS(test_main)(void *arg) (void)arg; NS_MOCK(router_parse_addr_policy_item_from_string); - NS(mock_addr_policy) = tor_malloc_zero(sizeof(NS(mock_addr_policy))); + NS(mock_addr_policy) = tor_malloc_zero(sizeof(addr_policy_t)); set = routerset_new(); s = "*"; @@ -1302,6 +1302,7 @@ NS(test_main)(void *arg) const char *nickname = "foo"; (void)arg; + memset(&ei, 0, sizeof(ei)); strmap_set_lc(set->names, nickname, (void *)1); strncpy(ei.nickname, nickname, sizeof(ei.nickname) - 1); ei.nickname[sizeof(ei.nickname) - 1] = '\0'; @@ -1330,6 +1331,7 @@ NS(test_main)(void *arg) const char *nickname = "foo"; (void)arg; + memset(&ri, 0, sizeof(ri)); strmap_set_lc(set->names, nickname, (void *)1); ri.nickname = (char *)nickname; @@ -1361,6 +1363,7 @@ NS(test_main)(void *arg) const char *nickname = "foo"; (void)arg; + memset(&rs, 0, sizeof(rs)); strmap_set_lc(set->names, nickname, (void *)1); strncpy(rs.nickname, nickname, sizeof(rs.nickname) - 1); rs.nickname[sizeof(rs.nickname) - 1] = '\0'; |