[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/release-0.2.2] Fix bug 4530; check return val of tor_addr_lookup correctly



commit b7015603fa014c91056fa46cb012976a9e166cd3
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Fri Dec 2 15:37:24 2011 -0500

    Fix bug 4530; check return val of tor_addr_lookup correctly
    
    Fix on 0.2.1.5-alpha; reported by troll_un
---
 changes/bug4530      |    6 ++++++
 src/common/address.c |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/changes/bug4530 b/changes/bug4530
new file mode 100644
index 0000000..7cd4726
--- /dev/null
+++ b/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".
+
diff --git a/src/common/address.c b/src/common/address.c
index 46ccb1f..17bdea9 100644
--- a/src/common/address.c
+++ b/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);
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits