summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-10-20 09:04:53 -0400
committerNick Mathewson <nickm@torproject.org>2014-10-20 09:04:53 -0400
commit2d4c40ee5f046ef99e530fc8808f302275c27788 (patch)
tree6a4b56d4c8c02b09343ca0716c469efd80c649cb
parent05791a0b72cbdf5d34fa7ae6660235e9e94945b7 (diff)
downloadtor-2d4c40ee5f046ef99e530fc8808f302275c27788.tar.gz
tor-2d4c40ee5f046ef99e530fc8808f302275c27788.zip
Fix a use-after-free error in cleaned-up rouerlist code.
Bug not in any released tor. This is CID 1248521
-rw-r--r--src/or/routerlist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 93f96328c2..5748dfd5f4 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -3974,10 +3974,10 @@ router_load_extrainfo_from_string(const char *s, const char *eos,
log_info(LD_DIR, "%d elements to add", smartlist_len(extrainfo_list));
SMARTLIST_FOREACH_BEGIN(extrainfo_list, extrainfo_t *, ei) {
- was_router_added_t added =
- router_add_extrainfo_to_routerlist(ei, &msg, from_cache, !from_cache);
uint8_t d[DIGEST_LEN];
memcpy(d, ei->cache_info.signed_descriptor_digest, DIGEST_LEN);
+ was_router_added_t added =
+ router_add_extrainfo_to_routerlist(ei, &msg, from_cache, !from_cache);
if (WRA_WAS_ADDED(added) && requested_fingerprints) {
char fp[HEX_DIGEST_LEN+1];
base16_encode(fp, sizeof(fp), descriptor_digests ?