From: Roger Dingledine Date: Mon, 9 Feb 2009 03:13:14 +0000 (+0000) Subject: uh, and commit the patch too. X-Git-Tag: tor-0.2.1.12-alpha~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=28d97f82620634a926b9b8dec1b7e1d465b0556b;p=thirdparty%2Ftor.git uh, and commit the patch too. svn:r18423 --- 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);