diff options
author | Roger Dingledine <arma@torproject.org> | 2009-02-09 03:13:14 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2009-02-09 03:13:14 +0000 |
commit | 28d97f82620634a926b9b8dec1b7e1d465b0556b (patch) | |
tree | 868c64b31b5d0c104b7ee7c7cefd6f054af70275 /src/or/routerparse.c | |
parent | fe987d3a1796c91bc6482874896c5912099d6d73 (diff) | |
download | tor-28d97f82620634a926b9b8dec1b7e1d465b0556b.tar.gz tor-28d97f82620634a926b9b8dec1b7e1d465b0556b.zip |
uh, and commit the patch too.
svn:r18423
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r-- | src/or/routerparse.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 71f9f9c193..444f22a2a2 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -1643,12 +1643,19 @@ authority_cert_parse_from_string(const char *s, const char **end_of_string) tok = find_opt_by_keyword(tokens, K_DIR_ADDRESS); if (tok) { + struct in_addr in; + char *address = NULL; tor_assert(tok->n_args); - if (parse_addr_port(LOG_WARN, tok->args[0], NULL, &cert->addr, - &cert->dir_port)<0) { + /* XXX021 use tor_addr_port_parse() below instead. -RD */ + if (parse_addr_port(LOG_WARN, tok->args[0], &address, NULL, + &cert->dir_port)<0 || + tor_inet_aton(address, &in) == 0) { log_warn(LD_DIR, "Couldn't parse dir-address in certificate"); + tor_free(address); goto err; } + cert->addr = ntohl(in.s_addr); + tor_free(address); } tok = find_by_keyword(tokens, K_DIR_KEY_PUBLISHED); |