]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
add copy of MyFamily element to the descriptor, not the element itself
authorRoger Dingledine <arma@torproject.org>
Thu, 25 May 2017 03:23:12 +0000 (23:23 -0400)
committerRoger Dingledine <arma@torproject.org>
Thu, 25 May 2017 03:37:00 +0000 (23:37 -0400)
If we add the element itself, we will later free it when we free the
descriptor, and the next time we go to look at MyFamily, things will
go badly.

Fixes the rest of bug 22368; bugfix on 0.3.1.1-alpha.

changes/bug22368 [new file with mode: 0644]
src/or/router.c

diff --git a/changes/bug22368 b/changes/bug22368
new file mode 100644 (file)
index 0000000..eb445d0
--- /dev/null
@@ -0,0 +1,6 @@
+  o Major bugfixes:
+    - Relays that set MyFamily no longer free the elements of
+      options->MyFamily while making their descriptor. They tried to
+      access the freed elements, and then double-free them, when making
+      the next descriptor or when changing the config. Fixes bug 22368;
+      bugfix on 0.3.1.1-alpha.
index b43742aa8343653fec810480548f9780aed6f124..f2741b70af2de221e4d29073f3d7b27559a7d63a 100644 (file)
@@ -2308,7 +2308,7 @@ router_build_fresh_descriptor(routerinfo_t **r, extrainfo_t **e)
            smartlist_add_strdup(warned_nonexistent_family, name);
          }
          if (is_legal) {
-           smartlist_add(ri->declared_family, name);
+           smartlist_add_strdup(ri->declared_family, name);
            name = NULL;
          }
        } else if (router_digest_is_me(member->identity)) {