summaryrefslogtreecommitdiff
path: root/src/core/proto
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-01-17 08:49:56 -0500
committerNick Mathewson <nickm@torproject.org>2020-01-17 08:49:56 -0500
commit5086b16055777f11b3d196d637b91a134adf4baf (patch)
treec06df27eafd99aaf185e7bc8b0d61cb74a370013 /src/core/proto
parent7f03ba06d8447025ef3e53906ebe9bcdd0d4d1b5 (diff)
parent4ae77e15d0ac8c6449d2a6588a7ebfab887954c1 (diff)
downloadtor-5086b16055777f11b3d196d637b91a134adf4baf.tar.gz
tor-5086b16055777f11b3d196d637b91a134adf4baf.zip
Merge remote-tracking branch 'tor-github/pr/1529'
Diffstat (limited to 'src/core/proto')
-rw-r--r--src/core/proto/proto_socks.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/proto/proto_socks.c b/src/core/proto/proto_socks.c
index 87074ff237..6fd08b2273 100644
--- a/src/core/proto/proto_socks.c
+++ b/src/core/proto/proto_socks.c
@@ -620,6 +620,7 @@ process_socks5_client_request(socks_request_t *req,
int safe_socks)
{
socks_result_t res = SOCKS_RESULT_DONE;
+ tor_addr_t tmpaddr;
if (req->command != SOCKS_COMMAND_CONNECT &&
req->command != SOCKS_COMMAND_RESOLVE &&
@@ -630,11 +631,10 @@ process_socks5_client_request(socks_request_t *req,
}
if (req->command == SOCKS_COMMAND_RESOLVE_PTR &&
- !string_is_valid_ipv4_address(req->address) &&
- !string_is_valid_ipv6_address(req->address)) {
+ tor_addr_parse(&tmpaddr, req->address) < 0) {
socks_request_set_socks5_error(req, SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED);
log_warn(LD_APP, "socks5 received RESOLVE_PTR command with "
- "hostname type. Rejecting.");
+ "a malformed address. Rejecting.");
res = SOCKS_RESULT_INVALID;
goto end;