mirror of
https://github.com/curl/curl.git
synced 2026-05-15 09:06:24 +03:00
setopt: check CURLOPT_ADDRESS_SCOPE option range
... and return error instead of triggering an assert() when being way out of range.
This commit is contained in:
parent
01596dbadf
commit
844896d064
1 changed files with 4 additions and 1 deletions
|
|
@ -2616,7 +2616,10 @@ CURLcode Curl_setopt(struct Curl_easy *data, CURLoption option,
|
||||||
* know that an unsigned int will always hold the value so we blindly
|
* know that an unsigned int will always hold the value so we blindly
|
||||||
* typecast to this type
|
* typecast to this type
|
||||||
*/
|
*/
|
||||||
data->set.scope_id = curlx_sltoui(va_arg(param, long));
|
arg = va_arg(param, long);
|
||||||
|
if((arg < 0) || (arg > 0xf))
|
||||||
|
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||||
|
data->set.scope_id = curlx_sltoui(arg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_PROTOCOLS:
|
case CURLOPT_PROTOCOLS:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue