aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dirparse
diff options
context:
space:
mode:
authorcypherpunks <cypherpunks@torproject.org>2020-02-08 20:10:40 +0000
committercypherpunks <cypherpunks@torproject.org>2020-02-09 01:24:47 +0000
commit5d330997f690845fadbd71f71f26a2ea464cd1ab (patch)
treefe5a8010c9a7fdbb0e77e46677122827912d5214 /src/feature/dirparse
parent44facb83d5b8801ec53135fab8a1f610d468fcd1 (diff)
downloadtor-5d330997f690845fadbd71f71f26a2ea464cd1ab.tar.gz
tor-5d330997f690845fadbd71f71f26a2ea464cd1ab.zip
dirparse: reject votes with malformed routerstatus entries
Diffstat (limited to 'src/feature/dirparse')
-rw-r--r--src/feature/dirparse/ns_parse.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/feature/dirparse/ns_parse.c b/src/feature/dirparse/ns_parse.c
index 109eebeb66..7cb92ebe59 100644
--- a/src/feature/dirparse/ns_parse.c
+++ b/src/feature/dirparse/ns_parse.c
@@ -1432,6 +1432,7 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
smartlist_add(ns->routerstatus_list, rs);
} else {
vote_routerstatus_free(rs);
+ goto err; // Malformed routerstatus, reject this vote.
}
} else {
routerstatus_t *rs;
@@ -1441,6 +1442,8 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
flav))) {
/* Use exponential-backoff scheduling when downloading microdescs */
smartlist_add(ns->routerstatus_list, rs);
+ } else {
+ goto err; // Malformed routerstatus, reject this vote.
}
}
}