mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:01:41 +03:00
urlapi: typecast CURLU_URLDECODE to uint when toggling it off
In this use case 'unsigned value &= ~DEFINE;' As otherwise the right side is treated as signed, which annoyingly triggers UBSan. Reported-by: xmoezzz on github Fixes #20753
This commit is contained in:
parent
4b583b7585
commit
454181cd66
1 changed files with 2 additions and 2 deletions
|
|
@ -1555,7 +1555,7 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what,
|
|||
case CURLUPART_SCHEME:
|
||||
ptr = u->scheme;
|
||||
ifmissing = CURLUE_NO_SCHEME;
|
||||
flags &= ~CURLU_URLDECODE; /* never for schemes */
|
||||
flags &= ~(unsigned int)CURLU_URLDECODE; /* never for schemes */
|
||||
if((flags & CURLU_NO_GUESS_SCHEME) && u->guessed_scheme)
|
||||
return CURLUE_NO_SCHEME;
|
||||
break;
|
||||
|
|
@ -1582,7 +1582,7 @@ CURLUcode curl_url_get(const CURLU *u, CURLUPart what,
|
|||
case CURLUPART_PORT:
|
||||
ptr = u->port;
|
||||
ifmissing = CURLUE_NO_PORT;
|
||||
flags &= ~CURLU_URLDECODE; /* never for port */
|
||||
flags &= ~(unsigned int)CURLU_URLDECODE; /* never for port */
|
||||
if(!ptr && (flags & CURLU_DEFAULT_PORT) && u->scheme) {
|
||||
/* there is no stored port number, but asked to deliver
|
||||
a default one for the scheme */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue