From: Stefan Eissing Date: Wed, 10 Sep 2025 09:55:24 +0000 (+0200) Subject: curl_easy_getinfo: error code on NULL arg X-Git-Tag: rc-8_17_0-1~415 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a782867c9f966b2daeb67a4438bc4c26c6bbd46b;p=thirdparty%2Fcurl.git curl_easy_getinfo: error code on NULL arg When passing an address to curl_easy_getinfo to retrieve a value and the address is NULL, return CURLE_BAD_FUNCTION_ARGUMENT instead of CURLE_UNKNOWN_OPTION. Closes #18512 --- diff --git a/lib/getinfo.c b/lib/getinfo.c index 7ff78d2d6d..e2a8231d53 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -621,7 +621,7 @@ CURLcode Curl_getinfo(struct Curl_easy *data, CURLINFO info, ...) struct curl_slist **param_slistp = NULL; curl_socket_t *param_socketp = NULL; int type; - CURLcode result = CURLE_UNKNOWN_OPTION; + CURLcode result = CURLE_BAD_FUNCTION_ARGUMENT; if(!data) return CURLE_BAD_FUNCTION_ARGUMENT; @@ -661,6 +661,7 @@ CURLcode Curl_getinfo(struct Curl_easy *data, CURLINFO info, ...) result = getinfo_socket(data, info, param_socketp); break; default: + result = CURLE_UNKNOWN_OPTION; break; }