mirror of
https://github.com/curl/curl.git
synced 2026-04-15 00:21:42 +03:00
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
This commit is contained in:
parent
80ac5fb2ec
commit
a782867c9f
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue