From: Daniel Stenberg Date: Sat, 12 Jun 2021 16:59:46 +0000 (+0200) Subject: multi: add scan-build-6 work-around in curl_multi_fdset X-Git-Tag: curl-7_78_0~142 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77bc35901f558c5198672099671b2d0eb3787566;p=thirdparty%2Fcurl.git multi: add scan-build-6 work-around in curl_multi_fdset scan-build-6 otherwise warns, saying: warning: The left operand of '>=' is a garbage value otherwise, which is false. Later scan-builds don't claim this on the same code. Closes #7248 --- diff --git a/lib/multi.c b/lib/multi.c index 1b3e261c68..d91f13db04 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -1043,7 +1043,12 @@ CURLMcode curl_multi_fdset(struct Curl_multi *multi, data = multi->easyp; while(data) { - int bitmap = multi_getsock(data, sockbunch); + int bitmap; +#ifdef __clang_analyzer_ + /* to prevent "The left operand of '>=' is a garbage value" warnings */ + memset(sockbunch, 0, sizeof(sockbunch)); +#endif + bitmap = multi_getsock(data, sockbunch); for(i = 0; i< MAX_SOCKSPEREASYHANDLE; i++) { curl_socket_t s = CURL_SOCKET_BAD;