aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2011-04-26 04:38:55 +0200
committerNick Mathewson <nickm@torproject.org>2011-05-09 13:19:46 -0400
commit1c668540fef93d71e72cfed73955ee705f27163e (patch)
tree3d57d776a859aaad6fe4924253f5327ed70582f2 /src
parent1827e60976d54d1917dfc54bdf62b4818662ac12 (diff)
downloadtor-1c668540fef93d71e72cfed73955ee705f27163e.tar
tor-1c668540fef93d71e72cfed73955ee705f27163e.tar.gz
Fix potential null pointer deref during dirvote
Found by using clang's analyzer.
Diffstat (limited to 'src')
-rw-r--r--src/or/dirvote.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index db2eaf0f4..750c649f5 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -444,9 +444,9 @@ compute_routerstatus_consensus(smartlist_t *votes, int consensus_method,
if (cur && !compare_vote_rs(cur, rs)) {
++cur_n;
} else {
- if (cur_n > most_n ||
- (cur && cur_n == most_n &&
- cur->status.published_on > most_published)) {
+ if (cur && (cur_n > most_n ||
+ (cur_n == most_n &&
+ cur->status.published_on > most_published))) {
most = cur;
most_n = cur_n;
most_published = cur->status.published_on;