mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
share: do bitshifts after the type is checked to be valid
Fixes #21224 Reported-by: bird on github
This commit is contained in:
parent
2e5d219205
commit
1c4f98e766
@ -281,7 +281,6 @@ CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
|
||||
case CURLSHOPT_UNSHARE:
|
||||
/* this is a type this share will no longer share */
|
||||
type = va_arg(param, int);
|
||||
share->specifier &= ~(unsigned int)(1 << type);
|
||||
switch(type) {
|
||||
case CURL_LOCK_DATA_DNS:
|
||||
break;
|
||||
@ -325,6 +324,8 @@ CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...)
|
||||
res = CURLSHE_BAD_OPTION;
|
||||
break;
|
||||
}
|
||||
if(!res)
|
||||
share->specifier &= ~(unsigned int)(1 << type);
|
||||
break;
|
||||
|
||||
case CURLSHOPT_LOCKFUNC:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user