Silence a GCC false positive warning. GCC 11.2.1 reportedly warns that CTR_DRBG_init may be passed an uninitialized personalization buffer. This appears to be a false positive, because personalization_len will be zero. But it's easy enough to zero-initialize it, so silence the warning. Bug: 432 Change-Id: I20f6b74e09f19962e8cae37d45090ff3d1c0215d Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/49245 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/crypto/fipsmodule/rand/rand.c b/crypto/fipsmodule/rand/rand.c index 29c43ae..0fc9fa1 100644 --- a/crypto/fipsmodule/rand/rand.c +++ b/crypto/fipsmodule/rand/rand.c
@@ -356,7 +356,7 @@ int used_cpu; rand_get_seed(state, seed, &used_cpu); - uint8_t personalization[CTR_DRBG_ENTROPY_LEN]; + uint8_t personalization[CTR_DRBG_ENTROPY_LEN] = {0}; size_t personalization_len = 0; #if defined(OPENSSL_URANDOM) // If we used RDRAND, also opportunistically read from the system. This