]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a use-after-free error in cleaned-up rouerlist code.
authorNick Mathewson <nickm@torproject.org>
Mon, 20 Oct 2014 13:04:53 +0000 (09:04 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 20 Oct 2014 13:04:53 +0000 (09:04 -0400)
Bug not in any released tor.  This is CID 1248521

src/or/routerlist.c

index 93f96328c26f1ad1cbf80fb9e54cf126239cae90..5748dfd5f452d817ea074307e19712ccec0242e3 100644 (file)
@@ -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 ?