[tor-commits] [tor/master] Add one more missing heck on bug4645 fixes

nickm at torproject.org nickm at torproject.org
Wed Apr 2 01:50:08 UTC 2014


commit 408bd98e79196933e447cbc68c73ecffebaf5a19
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Apr 1 21:10:14 2014 -0400

    Add one more missing heck on bug4645 fixes
---
 src/or/directory.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/or/directory.c b/src/or/directory.c
index 6effe45..d6d2339 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1415,9 +1415,8 @@ http_set_address_origin(const char *headers, connection_t *conn)
     fwd = http_get_header(headers, "X-Forwarded-For: ");
   if (fwd) {
     tor_addr_t toraddr;
-    tor_addr_parse(&toraddr,fwd);
-
-    if (tor_addr_is_internal(&toraddr,0)) {
+    if (tor_addr_parse(&toraddr,fwd) == -1 ||
+        tor_addr_is_internal(&toraddr,0)) {
       log_debug(LD_DIR, "Ignoring local/internal IP %s", escaped(fwd));
       tor_free(fwd);
       return;





More information about the tor-commits mailing list