From e3ed70ce720121ad9a9914101e29bc7028b7e046 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 20 Mar 2026 11:06:47 +0100 Subject: [PATCH] url: use the socks type for socks proxy Reported by Codex Security Closes #21025 --- lib/url.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/url.c b/lib/url.c index cd06d6c626..8f46f4eb20 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2248,16 +2248,16 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data, * connection that may exist registered to the same proxy host. ***********************************************************************/ if(proxy || socksproxy) { - long ptype = conn->http_proxy.proxytype; if(proxy) { - result = parse_proxy(data, conn, proxy, ptype); + result = parse_proxy(data, conn, proxy, conn->http_proxy.proxytype); Curl_safefree(proxy); /* parse_proxy copies the proxy string */ if(result) goto out; } if(socksproxy) { - result = parse_proxy(data, conn, socksproxy, ptype); + result = parse_proxy(data, conn, socksproxy, + conn->socks_proxy.proxytype); /* parse_proxy copies the socks proxy string */ Curl_safefree(socksproxy); if(result)