diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/or/policies.c | 5 | ||||
-rw-r--r-- | src/or/routerparse.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/or/policies.c b/src/or/policies.c index 20c1fb9186..a3af3c9522 100644 --- a/src/or/policies.c +++ b/src/or/policies.c @@ -530,10 +530,7 @@ compare_addr_to_addr_policy(uint32_t addr, uint16_t port, int match = 0; int maybe = 0; int i, len; - if (!policy) - return ADDR_POLICY_REJECTED; - - len = smartlist_len(policy); + len = policy ? smartlist_len(policy) : 0; for (i = 0; i < len; ++i) { addr_policy_t *tmpe = smartlist_get(policy, i); diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 1b77d992a3..31b10baf30 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -1272,6 +1272,10 @@ router_parse_entry_from_string(const char *s, const char *end, } exit_policy_tokens = find_all_exitpolicy(tokens); + if (!smartlist_len(exit_policy_tokens)) { + log_warn(LD_DIR, "No exit policy tokens in descriptor."); + goto err; + } SMARTLIST_FOREACH(exit_policy_tokens, directory_token_t *, t, if (router_add_exit_policy(router,t)<0) { log_warn(LD_DIR,"Error in exit policy"); |