urlapi: use U_CURLU_URLDECODE when toggling it off unsigned

In this use case 'unsigned value &= ~DEFINE;

As otherwise the right side is treated as signed, which annoyingly
triggers UBSan. The U_* defines are local versions of the public define,
only typecast to unsigned.

Reported-by: xmoezzz on github
Fixes #20753
Closes #20769
This commit is contained in:
Daniel Stenberg 2026-02-28 10:48:59 +01:00
parent cc85cdf3c5
commit 3d708e239b
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 6 additions and 3 deletions

View file

@ -37,4 +37,7 @@ UNITTEST CURLUcode Curl_parse_port(struct Curl_URL *u, struct dynbuf *host,
bool has_scheme);
#endif
#define U_CURLU_URLDECODE (unsigned int)CURLU_URLDECODE
#define U_CURLU_PATH_AS_IS (unsigned int)CURLU_PATH_AS_IS
#endif /* HEADER_CURL_URLAPI_INT_H */