]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Use string_is_valid_hostname in SOCKS4 request parsing codepath
authorrl1987 <rl1987@sdf.lonestar.org>
Sun, 4 Jun 2017 11:22:45 +0000 (13:22 +0200)
committerrl1987 <rl1987@sdf.lonestar.org>
Sun, 4 Jun 2017 11:22:45 +0000 (13:22 +0200)
src/or/buffers.c

index 399b591d1c39bd59a30efba872c8852e798c0338..1907d69cfb8698caca8da5e742f48b9f35e18aad 100644 (file)
@@ -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.",