Fix bug 4530; check return val of tor_addr_lookup correctly

Fix on 0.2.1.5-alpha; reported by troll_un
This commit is contained in:
Nick Mathewson 2011-12-02 15:37:24 -05:00
parent 3ebe960f3f
commit b7015603fa
2 changed files with 7 additions and 1 deletions

6
changes/bug4530 Normal file
View File

@ -0,0 +1,6 @@
o Minor bugfixes:
- Correctly detect and handle transient lookup failures from
tor_addr_lookup. Fixes bug 4530; bugfix on 0.2.1.5-alpha.
Reported by "troll_un".

View File

@ -1034,7 +1034,7 @@ tor_addr_port_parse(const char *s, tor_addr_t *addr_out, uint16_t *port_out)
++port; ++port;
} }
if (tor_addr_lookup(tmp, AF_UNSPEC, &addr) < 0) if (tor_addr_lookup(tmp, AF_UNSPEC, &addr) != 0)
goto err; goto err;
tor_free(tmp); tor_free(tmp);