r18898@catbus: nickm | 2008-03-17 16:25:58 -0400
Partial backport: Fix bug in earlier bugfix. Disallow empty exit policies in router descriptors. svn:r14083
This commit is contained in:
parent
5e63abc20b
commit
5109f64107
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue