From 7448054c38c547af171cb1a8df4c5c08b9d86ae5 Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Fri, 23 Feb 2024 22:02:09 -0500 Subject: [PATCH] setopt: fix check for CURLOPT_PROXY_TLSAUTH_TYPE value Prior to this change CURLOPT_PROXY_TLSAUTH_TYPE would return CURLE_BAD_FUNCTION_ARGUMENT on any type other than NULL. Since there is only one type of TLS auth and it is also the default (SRP) the TLS auth would work anyway. Closes https://github.com/curl/curl/pull/12981 --- lib/setopt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/setopt.c b/lib/setopt.c index e5614cd35140d7..6a4990cce6731b 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -2864,13 +2864,13 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) #endif case CURLOPT_TLSAUTH_TYPE: argptr = va_arg(param, char *); - if(argptr && !strncasecompare(argptr, "SRP", strlen("SRP"))) + if(argptr && !strcasecompare(argptr, "SRP")) return CURLE_BAD_FUNCTION_ARGUMENT; break; #ifndef CURL_DISABLE_PROXY case CURLOPT_PROXY_TLSAUTH_TYPE: argptr = va_arg(param, char *); - if(argptr || !strncasecompare(argptr, "SRP", strlen("SRP"))) + if(argptr && !strcasecompare(argptr, "SRP")) return CURLE_BAD_FUNCTION_ARGUMENT; break; #endif