From: Scott Talbert Date: Sat, 24 Feb 2024 03:02:09 +0000 (-0500) Subject: setopt: fix check for CURLOPT_PROXY_TLSAUTH_TYPE value X-Git-Tag: curl-8_7_0~142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7448054c38c547af171cb1a8df4c5c08b9d86ae5;p=thirdparty%2Fcurl.git 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 --- diff --git a/lib/setopt.c b/lib/setopt.c index e5614cd351..6a4990cce6 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