CURLMOPT_MAX_CONCURRENT_STREAMS: make sure the set value is within range

... or use the default value.

Also clarify the documentation language somewhat.

Closes #12382
This commit is contained in:
Daniel Stenberg 2023-11-22 10:54:40 +01:00
parent 2d06eebf28
commit 9a8bb20d48
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 4 additions and 4 deletions

View file

@ -3293,9 +3293,9 @@ CURLMcode curl_multi_setopt(struct Curl_multi *multi,
case CURLMOPT_MAX_CONCURRENT_STREAMS:
{
long streams = va_arg(param, long);
if(streams < 1)
if((streams < 1) || (streams > INT_MAX))
streams = 100;
multi->max_concurrent_streams = curlx_sltoui(streams);
multi->max_concurrent_streams = (unsigned int)streams;
}
break;
default: