diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-08-01 17:25:34 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-08-01 17:25:34 -0400 |
commit | 2d6d5db2fe4f8a4538c5bed903f7e1576e9eea40 (patch) | |
tree | 5e105f63e2213011a66daf38a3b85b7df47c7c20 /src | |
parent | 122c8efb09643a65cbec6c991f3433774a4524ae (diff) | |
download | tor-2d6d5db2fe4f8a4538c5bed903f7e1576e9eea40.tar.gz tor-2d6d5db2fe4f8a4538c5bed903f7e1576e9eea40.zip |
Defensive programming: clear rs_out between iterations.
I can't currently find a bug here, but there are a couple of
near-misses. Addresses ticket 6514; reported pseudonymously on
IRC.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/dirvote.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 79958739a5..bc7797355c 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -1752,6 +1752,7 @@ networkstatus_compute_consensus(smartlist_t *votes, rs = compute_routerstatus_consensus(matching_descs, consensus_method, microdesc_digest); /* Copy bits of that into rs_out. */ + memset(&rs_out, 0, sizeof(rs_out)); tor_assert(fast_memeq(lowest_id, rs->status.identity_digest,DIGEST_LEN)); memcpy(rs_out.identity_digest, lowest_id, DIGEST_LEN); memcpy(rs_out.descriptor_digest, rs->status.descriptor_digest, |