Skip to content
Snippets Groups Projects
Unverified Commit ba83c1e5 authored by teor's avatar teor
Browse files

dirparse: Stop crashing when parsing unknown descriptor purpose annotations

We think this bug can only be triggered by modifying a local file.

Fixes bug 30781; bugfix on 0.2.0.8-alpha.
parent 4e262196
No related branches found
No related tags found
No related merge requests found
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.
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment