aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-09-02 11:55:53 -0400
committerNick Mathewson <nickm@torproject.org>2014-09-02 11:56:56 -0400
commitefcab439564dcadc5bc14609a9205d73d236e966 (patch)
tree32b90aeed52b5d76bb862bd824b16bf0e2c7829a /src/or/dirvote.c
parent8139db372528ca02cd572f3f7848e9d174a9b12e (diff)
downloadtor-efcab439564dcadc5bc14609a9205d73d236e966.tar.gz
tor-efcab439564dcadc5bc14609a9205d73d236e966.zip
Fix a number of clang analyzer false-positives
Most of these are in somewhat non-obvious code where it is probably a good idea to initialize variables and add extra assertions anyway. Closes 13036. Patches from "teor".
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r--src/or/dirvote.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index c7be343ca2..137d6c1a8c 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -335,6 +335,9 @@ static int
compare_vote_rs(const vote_routerstatus_t *a, const vote_routerstatus_t *b)
{
int r;
+ tor_assert(a);
+ tor_assert(b);
+
if ((r = fast_memcmp(a->status.identity_digest, b->status.identity_digest,
DIGEST_LEN)))
return r;
@@ -432,6 +435,7 @@ compute_routerstatus_consensus(smartlist_t *votes, int consensus_method,
const tor_addr_port_t *most_alt_orport = NULL;
SMARTLIST_FOREACH_BEGIN(votes, vote_routerstatus_t *, rs) {
+ tor_assert(rs);
if (compare_vote_rs(most, rs) == 0 &&
!tor_addr_is_null(&rs->status.ipv6_addr)
&& rs->status.ipv6_orport) {