diff options
author | teor <teor@torproject.org> | 2019-08-10 07:21:56 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-08-10 07:21:56 +1000 |
commit | 254c1bac453fdb7d3e29a5cde9757542990a6989 (patch) | |
tree | 1b5cc1d0830199cbcc6e704b3a825b43a0fa2ded | |
parent | e07d08a169c3dd43f4cd134c8f993c3f199c2bcc (diff) | |
parent | ba83c1e5cf0e4ba0d63cb3728da059a9b241a161 (diff) | |
download | tor-254c1bac453fdb7d3e29a5cde9757542990a6989.tar.gz tor-254c1bac453fdb7d3e29a5cde9757542990a6989.zip |
Merge remote-tracking branch 'tor-github/pr/1078' into maint-0.2.9
-rw-r--r-- | changes/bug30781 | 4 | ||||
-rw-r--r-- | src/or/routerparse.c | 3 |
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 37d2d975fc..f046cc39b4 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -1921,6 +1921,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; } |