fix building failure when using -Wconditional-uninitialized
authorfangming.fang <fangming.fang@arm.com>
Tue, 28 Dec 2021 04:13:21 +0000 (04:13 +0000)
committerTomas Mraz <tomas@openssl.org>
Wed, 5 Jan 2022 08:59:31 +0000 (09:59 +0100)
Use clang -Wconditional-uninitialized to build, the error "initialize
the variable 'buffer_size' to silence this warning" will be reported.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17375)

crypto/armcap.c

index 117c57efe4232a707e0ce802dc47fa59003b7113..72ed0a024acef93cd8f9a28ec74ecc534c902795 100644 (file)
@@ -65,7 +65,7 @@ size_t OPENSSL_rndrrs_bytes(unsigned char *buf, size_t len);
 
 static size_t OPENSSL_rndr_wrapper(size_t (*func)(unsigned char *, size_t), unsigned char *buf, size_t len)
 {
-    size_t buffer_size;
+    size_t buffer_size = 0;
     int i;
 
     for (i = 0; i < 8; i++) {