aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-09-15 19:35:16 -0400
committerNick Mathewson <nickm@torproject.org>2009-09-15 19:35:16 -0400
commit24c740e5fdfa1897b2e8de045d11c419d1e0b5d4 (patch)
tree9b2acca7570d56c11ff0580192e13b7a1f5b0c7f /src
parent113ba0e7270147b6eed10668970e1719139c4f27 (diff)
parentb792afa91901abaa04417051d1369fa8e643d90d (diff)
downloadtor-24c740e5fdfa1897b2e8de045d11c419d1e0b5d4.tar.gz
tor-24c740e5fdfa1897b2e8de045d11c419d1e0b5d4.zip
Merge commit 'sebastian/memleak' into maint-0.2.1
Diffstat (limited to 'src')
-rw-r--r--src/or/routerparse.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 97dd20f4e3..189458ee1e 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -2509,6 +2509,14 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
} else {
if (tok->object_size >= INT_MAX)
goto err;
+ /* We already parsed a vote from this voter. Use the first one. */
+ if (v->signature) {
+ log_fn(LOG_PROTOCOL_WARN, LD_DIR, "We received a networkstatus "
+ "that contains two votes from the same voter. Ignoring "
+ "the second vote.");
+ continue;
+ }
+
v->signature = tor_memdup(tok->object_body, tok->object_size);
v->signature_len = (int) tok->object_size;
}