summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-06-06 09:53:02 +1000
committerteor <teor@torproject.org>2019-06-06 09:53:02 +1000
commitdc8e3cd5ce2affb849ed07db8b4a7788769c5935 (patch)
tree5c540082fe6f0c7703530c051f4bf7f15dd1b090
parenta521c427883697fcfa027ffd72bb38f3aee5aceb (diff)
parentba83c1e5cf0e4ba0d63cb3728da059a9b241a161 (diff)
downloadtor-dc8e3cd5ce2affb849ed07db8b4a7788769c5935.tar.gz
tor-dc8e3cd5ce2affb849ed07db8b4a7788769c5935.zip
Merge branch 'bug30781_029' into bug30781_034
-rw-r--r--changes/bug307814
-rw-r--r--src/or/routerparse.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/changes/bug30781 b/changes/bug30781
new file mode 100644
index 0000000000..7c7adf470e
--- /dev/null
+++ b/changes/bug30781
@@ -0,0 +1,4 @@
+ o Minor bugfixes (directory authorities):
+ - Stop crashing after parsing an unknown descriptor purpose annotation.
+ We think this bug can only be triggered by modifying a local file.
+ Fixes bug 30781; bugfix on 0.2.0.8-alpha.
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index e82ecec5b7..bf0ae67ada 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1661,6 +1661,9 @@ router_parse_entry_from_string(const char *s, const char *end,
if ((tok = find_opt_by_keyword(tokens, A_PURPOSE))) {
tor_assert(tok->n_args);
router->purpose = router_purpose_from_string(tok->args[0]);
+ if (router->purpose == ROUTER_PURPOSE_UNKNOWN) {
+ goto err;
+ }
} else {
router->purpose = ROUTER_PURPOSE_GENERAL;
}