aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2016-08-14 17:05:32 +0200
committerMarc Hoersken <info@marc-hoersken.de>2016-08-14 17:05:32 +0200
commitcc3384a254bbffc64f3dd2a2d3d61fe84ec7472d (patch)
tree8ec27c16d78733af3ed3662e7b5d23843369aac6 /lib
parent59580e12bac9e62075523d056aa36d8a92432283 (diff)
socks.c: Do not modify and invalidate calculated response length
Second commit to fix issue #944 regarding SOCKS5 error handling. Reported-by: David Kalnischkies
Diffstat (limited to 'lib')
-rw-r--r--lib/socks.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/socks.c b/lib/socks.c
index a3c6ee088..bb93e424a 100644
--- a/lib/socks.c
+++ b/lib/socks.c
@@ -702,10 +702,9 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
/* decrypt_gssapi_blockread already read the whole packet */
#endif
if(len > 10) {
- len -= 10;
result = Curl_blockread_all(conn, sock, (char *)&socksreq[10],
- len, &actualread);
- if(result || (len != actualread)) {
+ len - 10, &actualread);
+ if(result || ((len - 10) != actualread)) {
failf(data, "Failed to receive SOCKS5 connect request ack.");
return CURLE_COULDNT_CONNECT;
}