mirror of
https://github.com/curl/curl.git
synced 2026-08-26 16:53:32 +03:00
socks: handle premature close
When expecting to receive a number of bytes during socks connect, treat an early connection close as error. Reported-by: Joshua Rogers Closes #18883
This commit is contained in:
parent
4a6bdd5899
commit
089afd78cb
1 changed files with 7 additions and 1 deletions
|
|
@ -254,8 +254,14 @@ static CURLproxycode socks_recv(struct socks_state *sx,
|
||||||
curl_easy_strerror(result));
|
curl_easy_strerror(result));
|
||||||
return CURLPX_RECV_CONNECT;
|
return CURLPX_RECV_CONNECT;
|
||||||
}
|
}
|
||||||
else if(!nread) /* EOF */
|
else if(!nread) { /* EOF */
|
||||||
|
if(Curl_bufq_len(&sx->iobuf) < min_bytes) {
|
||||||
|
failf(data, "Failed to receive SOCKS response, "
|
||||||
|
"proxy closed connection");
|
||||||
|
return CURLPX_RECV_CONNECT;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*done = TRUE;
|
*done = TRUE;
|
||||||
return CURLPX_OK;
|
return CURLPX_OK;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue