← Commit list

7813d9a077

Daniel Stenberg
Daniel Stenberg
2026-04-05
SUCCESS Duration: 289s

Subject

share: do bitshifts after the type is checked to be valid

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/curl_share.c+2 -1
@@ -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: