]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge branch 'bug13315_squashed'
authorNick Mathewson <nickm@torproject.org>
Tue, 4 Nov 2014 05:48:25 +0000 (00:48 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 4 Nov 2014 05:48:25 +0000 (00:48 -0500)
Conflicts:
src/or/buffers.c

1  2 
src/common/util.c
src/common/util.h
src/or/buffers.c
src/test/test_socks.c
src/test/test_util.c

Simple merge
Simple merge
index 080d8fb6c7bd12620091e55a50a03f7157b50c04,691845ec10cf345e7789850234eebce272cc97d5..bd33fe451da9762b8f5024d146f1ff075d843e3e
@@@ -2054,8 -2048,18 +2054,20 @@@ parse_socks(const char *data, size_t da
            req->address[len] = 0;
            req->port = ntohs(get_uint16(data+5+len));
            *drain_out = 5+len+2;
-           if (!tor_strisprint(req->address) || strchr(req->address,'\"')) {
+           if (string_is_valid_ipv4_address(req->address) ||
+               string_is_valid_ipv6_address(req->address)) {
+             log_unsafe_socks_warning(5,req->address,req->port,safe_socks);
+             if (safe_socks) {
+               socks_request_set_socks5_error(req, SOCKS5_NOT_ALLOWED);
+               return -1;
+             }
+           }
+           if (!string_is_valid_hostname(req->address)) {
 +            socks_request_set_socks5_error(req, SOCKS5_GENERAL_ERROR);
++
              log_warn(LD_PROTOCOL,
                       "Your application (using socks5 to port %d) gave Tor "
                       "a malformed hostname: %s. Rejecting the connection.",
Simple merge
Simple merge