mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Parse votes with >31 flags correctly
We were doing (1<<p) to generate a flag at position p, but we should have been doing (U64_LITERAL(1)<<p). Fixes bug 6861; bugfix on 0.2.0.3-alpha; reported pseudonymously.
This commit is contained in:
parent
b1447a4312
commit
414adb237b
3
changes/bug6853
Normal file
3
changes/bug6853
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
o Minor bugfixes (directory authority):
|
||||||
|
- Correctly handle votes with more than 31 flags. Fixes bug 6853;
|
||||||
|
bugfix on 0.2.0.3-alpha.
|
@ -2067,7 +2067,7 @@ routerstatus_parse_entry_from_string(memarea_t *area,
|
|||||||
for (i=0; i < tok->n_args; ++i) {
|
for (i=0; i < tok->n_args; ++i) {
|
||||||
int p = smartlist_string_pos(vote->known_flags, tok->args[i]);
|
int p = smartlist_string_pos(vote->known_flags, tok->args[i]);
|
||||||
if (p >= 0) {
|
if (p >= 0) {
|
||||||
vote_rs->flags |= (1<<p);
|
vote_rs->flags |= (U64_LITERAL(1)<<p);
|
||||||
} else {
|
} else {
|
||||||
log_warn(LD_DIR, "Flags line had a flag %s not listed in known_flags.",
|
log_warn(LD_DIR, "Flags line had a flag %s not listed in known_flags.",
|
||||||
escaped(tok->args[i]));
|
escaped(tok->args[i]));
|
||||||
|
Loading…
Reference in New Issue
Block a user