]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
rand: drop scan-build silencer
authorViktor Szakats <commit@vsz.me>
Sun, 8 Mar 2026 20:03:37 +0000 (21:03 +0100)
committerViktor Szakats <commit@vsz.me>
Mon, 9 Mar 2026 10:35:19 +0000 (11:35 +0100)
scan-build has been dropped in favor of clang-tidy and this false
positive no longer triggers with it.

Follow-up to ce4db9c2efca0bd89e556e231d940c988d84a606 #20751
Follow-up to 02f207a76b45129e4d033c099e6d17581801c76e

Closes #20860

lib/rand.c

index 007d13e8437a43a4f5a032ba7447d68b0982d3bd..4232e819e17bbf101bfd7cd7593b9c72f28465ee 100644 (file)
@@ -206,12 +206,6 @@ CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd, size_t num)
   unsigned char buffer[128];
   DEBUGASSERT(num > 1);
 
-#ifdef __clang_analyzer__
-  /* This silences a scan-build warning about accessing this buffer with
-     uninitialized memory. */
-  memset(buffer, 0, sizeof(buffer));
-#endif
-
   if((num / 2 >= sizeof(buffer)) || !(num & 1)) {
     /* make sure it fits in the local buffer and that it is an odd number! */
     DEBUGF(infof(data, "invalid buffer size with Curl_rand_hex"));