During the SOCKS connect phase, the `iobuf` is used to receive repsonses
from the server. If the server sends more bytes than expected, the code
discarded them silently.
Fix this by advancing the iobuf only with the length consumed.
Reported-by: Joshua Rogers
Closes #18938
switch(resp[1]) {
case 90:
CURL_TRC_CF(data, cf, "SOCKS4%s request granted.", sx->socks4a ? "a" : "");
- Curl_bufq_reset(&sx->iobuf);
+ Curl_bufq_skip(&sx->iobuf, 8);
return CURLPX_OK;
case 91:
failf(data,
}
auth_mode = resp[1];
- Curl_bufq_reset(&sx->iobuf);
+ Curl_bufq_skip(&sx->iobuf, 2);
switch(auth_mode) {
case 0:
/* ignore the first (VER) byte */
auth_status = resp[1];
- Curl_bufq_reset(&sx->iobuf);
+ Curl_bufq_skip(&sx->iobuf, 2);
if(auth_status) {
failf(data, "User was rejected by the SOCKS5 server (%d %d).",