← Commit list

8d302ec936

Daniel Stenberg
Daniel Stenberg
2025-10-19
SUCCESS Duration: 177s

Subject

socks: avoid UAF risk in error path

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+1 -2
@@ -765,13 +765,12 @@ static CURLproxycode socks5_check_auth_resp(struct socks_state *sx,
/* ignore the first (VER) byte */
auth_status = resp[1];
- Curl_bufq_skip(&sx->iobuf, 2);
-
if(auth_status) {
failf(data, "User was rejected by the SOCKS5 server (%d %d).",
resp[0], resp[1]);
return CURLPX_USER_REJECTED;
}
+ Curl_bufq_skip(&sx->iobuf, 2);
return CURLPX_OK;
}