From: Sergey Markelov Date: Thu, 5 May 2022 00:22:19 +0000 (-0700) Subject: urlapi: address (harmless) UndefinedBehavior sanitizer warning X-Git-Tag: curl-7_83_1~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b5b86856a92bc190d813d31914f2bea89a886d94;p=thirdparty%2Fcurl.git urlapi: address (harmless) UndefinedBehavior sanitizer warning `while(i--)` causes runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long') Closes #8797 --- diff --git a/lib/urlapi.c b/lib/urlapi.c index 99a0f69282..479596acd1 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -228,7 +228,7 @@ static void strcpy_url(char *output, const char *url, bool relative) */ bool Curl_is_absolute_url(const char *url, char *buf, size_t buflen) { - size_t i; + int i; DEBUGASSERT(!buf || (buflen > MAX_SCHEME_LEN)); (void)buflen; /* only used in debug-builds */ if(buf)