mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:51:53 +03:00
share: do bitshifts after the type is checked to be valid
Fixes #21224 Reported-by: bird on github Closes #21226
This commit is contained in:
parent
8968a68eba
commit
7813d9a077
1 changed files with 2 additions and 1 deletions
|
|
@ -281,7 +281,6 @@ CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
|
||||||
case CURLSHOPT_UNSHARE:
|
case CURLSHOPT_UNSHARE:
|
||||||
/* this is a type this share will no longer share */
|
/* this is a type this share will no longer share */
|
||||||
type = va_arg(param, int);
|
type = va_arg(param, int);
|
||||||
share->specifier &= ~(unsigned int)(1 << type);
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case CURL_LOCK_DATA_DNS:
|
case CURL_LOCK_DATA_DNS:
|
||||||
break;
|
break;
|
||||||
|
|
@ -325,6 +324,8 @@ CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
|
||||||
res = CURLSHE_BAD_OPTION;
|
res = CURLSHE_BAD_OPTION;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if(!res)
|
||||||
|
share->specifier &= ~(unsigned int)(1 << type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLSHOPT_LOCKFUNC:
|
case CURLSHOPT_LOCKFUNC:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue