From 408bd98e79196933e447cbc68c73ecffebaf5a19 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 1 Apr 2014 21:10:14 -0400 Subject: 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 6effe45db4..d6d2339e9b 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; -- cgit v1.2.3-54-g00ecf