← Commit list

089afd78cb

Stefan Eissing
Stefan Eissing
2025-10-07
SUCCESS Duration: 157s

Subject

socks: handle premature close

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/socks.c+7 -1
@@ -254,8 +254,14 @@ static CURLproxycode socks_recv(struct socks_state *sx,
curl_easy_strerror(result));
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;
+ }
}
*done = TRUE;
return CURLPX_OK;