Browse Source

Fix bug 4530; check return val of tor_addr_lookup correctly

Fix on 0.2.1.5-alpha; reported by troll_un
Nick Mathewson 12 years ago
parent
commit
b7015603fa
2 changed files with 7 additions and 1 deletions
  1. 6 0
      changes/bug4530
  2. 1 1
      src/common/address.c

+ 6 - 0
changes/bug4530

@@ -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".
+

+ 1 - 1
src/common/address.c

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