diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-06-09 01:00:23 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-06-09 01:01:55 +0200 |
commit | 844896d06416c9fdcacad5159f2a1a1d0293b9e5 (patch) | |
tree | 49d8264faa136cbaf15100009b09fcccc39241f8 /lib/url.c | |
parent | 01596dbadf5515da6282b210dcaf2dba724c7e81 (diff) | |
download | curl-844896d06416c9fdcacad5159f2a1a1d0293b9e5.tar.gz |
setopt: check CURLOPT_ADDRESS_SCOPE option range
... and return error instead of triggering an assert() when being way
out of range.
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 5 |
1 files changed, 4 insertions, 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 * 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; case CURLOPT_PROTOCOLS: |