diff options
author | Cherish98 <66007047+Cherish98@users.noreply.github.com> | 2020-06-05 17:36:11 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-06-05 23:20:10 +0200 |
commit | e980cbb8e7ca568719c7a9e9e31d566002d92f72 (patch) | |
tree | 3e0626322480f5775bfb0efdc9a012f9cf7ad10b /lib | |
parent | bba83ed285a0002b267eaed136ae341269f2a775 (diff) | |
download | curl-e980cbb8e7ca568719c7a9e9e31d566002d92f72.tar.gz |
socks: fix expected length of SOCKS5 reply
Commit 4a4b63d forgot to set the expected SOCKS5 reply length when the
reply ATYP is X'01'. This resulted in erroneously expecting more bytes
when the request length is greater than the reply length (e.g., when
remotely resolving the hostname).
Closes #5527
Diffstat (limited to 'lib')
-rw-r--r-- | lib/socks.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/socks.c b/lib/socks.c index 6031096f9..98b7818d8 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -935,6 +935,13 @@ CURLcode Curl_SOCKS5(const char *proxy_user, /* IPv6 */ len = 4 + 16 + 2; } + else if(socksreq[3] == 1) { + len = 4 + 4 + 2; + } + else { + failf(data, "SOCKS5 reply has wrong address type."); + return CURLE_COULDNT_CONNECT; + } /* At this point we already read first 10 bytes */ #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) |