[tor-commits] [tor/master] Use string_is_valid_hostname in SOCKS4 request parsing codepath

nickm at torproject.org nickm at torproject.org
Thu Jun 22 12:17:00 UTC 2017


commit f8c98759e56d9af14c1046dc629d6f03330ac031
Author: rl1987 <rl1987 at sdf.lonestar.org>
Date:   Sun Jun 4 13:22:45 2017 +0200

    Use string_is_valid_hostname in SOCKS4 request parsing codepath
---
 src/or/buffers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/or/buffers.c b/src/or/buffers.c
index 399b591..1907d69 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -1806,7 +1806,7 @@ parse_socks(const char *data, size_t datalen, socks_request_t *req,
       log_debug(LD_APP,"socks4: Everything is here. Success.");
       strlcpy(req->address, startaddr ? startaddr : tmpbuf,
               sizeof(req->address));
-      if (!tor_strisprint(req->address) || strchr(req->address,'\"')) {
+      if (!string_is_valid_hostname(req->address)) {
         log_warn(LD_PROTOCOL,
                  "Your application (using socks4 to port %d) gave Tor "
                  "a malformed hostname: %s. Rejecting the connection.",





More information about the tor-commits mailing list