aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-05-25 08:54:51 -0400
committerNick Mathewson <nickm@torproject.org>2017-05-25 08:54:51 -0400
commitab9976b7245f05a97e0285265c4cfcb225bd48e2 (patch)
tree4b4b4946dee19c27858c9453872e53d1ff67ef06
parent657297a9f8bedfab2dadfaee53768a1f9b8a558e (diff)
parent5f74749fbabe1122cbcd812c56ab0dc77c358f9d (diff)
downloadtor-ab9976b7245f05a97e0285265c4cfcb225bd48e2.tar.gz
tor-ab9976b7245f05a97e0285265c4cfcb225bd48e2.zip
Merge remote-tracking branch 'arma/bug22368'
-rw-r--r--changes/bug223686
-rw-r--r--src/or/router.c7
2 files changed, 8 insertions, 5 deletions
diff --git a/changes/bug22368 b/changes/bug22368
new file mode 100644
index 0000000000..eb445d0e43
--- /dev/null
+++ b/changes/bug22368
@@ -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.
diff --git a/src/or/router.c b/src/or/router.c
index 642f415a38..9b4c2445f4 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2289,7 +2289,7 @@ router_build_fresh_descriptor(routerinfo_t **r, extrainfo_t **e)
char *name = family->value;
const node_t *member;
if (!strcasecmp(name, options->Nickname))
- goto skip; /* Don't list ourself, that's redundant */
+ continue; /* Don't list ourself, that's redundant */
else
member = node_get_by_nickname(name, 1);
if (!member) {
@@ -2308,8 +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);
- name = NULL;
+ smartlist_add_strdup(ri->declared_family, name);
}
} else if (router_digest_is_me(member->identity)) {
/* Don't list ourself in our own family; that's redundant */
@@ -2323,8 +2322,6 @@ router_build_fresh_descriptor(routerinfo_t **r, extrainfo_t **e)
if (smartlist_contains_string(warned_nonexistent_family, name))
smartlist_string_remove(warned_nonexistent_family, name);
}
- skip:
- tor_free(name);
}
/* remove duplicates from the list */