]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Parse votes with >31 flags correctly
authorNick Mathewson <nickm@torproject.org>
Mon, 17 Sep 2012 14:24:52 +0000 (10:24 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 17 Sep 2012 14:24:52 +0000 (10:24 -0400)
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.

changes/bug6853 [new file with mode: 0644]
src/or/routerparse.c

diff --git a/changes/bug6853 b/changes/bug6853
new file mode 100644 (file)
index 0000000..382adfb
--- /dev/null
@@ -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.
index 2bf072b3cf6f9e94ff03d4e18ac638d9670239f5..022add393fb73220de36dcc3637e564ffb01ebd3 100644 (file)
@@ -2067,7 +2067,7 @@ routerstatus_parse_entry_from_string(memarea_t *area,
     for (i=0; i < tok->n_args; ++i) {
       int p = smartlist_string_pos(vote->known_flags, tok->args[i]);
       if (p >= 0) {
-        vote_rs->flags |= (1<<p);
+        vote_rs->flags |= (U64_LITERAL(1)<<p);
       } else {
         log_warn(LD_DIR, "Flags line had a flag %s not listed in known_flags.",
                  escaped(tok->args[i]));