mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 13:53:31 +01:00
FIx undefined behavior in dirvote.c
Fix a bug in the voting algorithm that could yield incorrect results when a non-naming authority declared too many flags. Fixes bug 9200; bugfix on 0.2.0.3-alpha. Found by coverity scan.
This commit is contained in:
parent
81a5ee77ec
commit
15cd79f832
5
changes/bug9200
Normal file
5
changes/bug9200
Normal file
@ -0,0 +1,5 @@
|
||||
o Major bugfixes:
|
||||
- Fix a bug in the voting algorithm that could yield incorrect results
|
||||
when a non-naming authority declared too many flags. Fixes bug 9200;
|
||||
bugfix on 0.2.0.3-alpha.
|
||||
|
@ -1727,7 +1727,8 @@ networkstatus_compute_consensus(smartlist_t *votes,
|
||||
if (rs->flags & (U64_LITERAL(1) << i))
|
||||
++flag_counts[flag_map[v_sl_idx][i]];
|
||||
}
|
||||
if (rs->flags & (U64_LITERAL(1) << named_flag[v_sl_idx])) {
|
||||
if (named_flag[v_sl_idx] >= 0 &&
|
||||
(rs->flags & (U64_LITERAL(1) << named_flag[v_sl_idx]))) {
|
||||
if (chosen_name && strcmp(chosen_name, rs->status.nickname)) {
|
||||
log_notice(LD_DIR, "Conflict on naming for router: %s vs %s",
|
||||
chosen_name, rs->status.nickname);
|
||||
|
Loading…
Reference in New Issue
Block a user