summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/rand.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libcurl/src/rand.c')
-rw-r--r--libs/libcurl/src/rand.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/libcurl/src/rand.c b/libs/libcurl/src/rand.c
index 2670af9d97..0769ed1512 100644
--- a/libs/libcurl/src/rand.c
+++ b/libs/libcurl/src/rand.c
@@ -157,6 +157,12 @@ CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd,
unsigned char *bufp = buffer;
DEBUGASSERT(num > 1);
+#ifdef __clang_analyzer__
+ /* This silences a scan-build warning about accesssing 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! */
return CURLE_BAD_FUNCTION_ARGUMENT;