Fix OSSL_STORE's 'file' loader: make sure peekbuf is initialised
authorRichard Levitte <levitte@openssl.org>
Tue, 5 Sep 2017 10:42:58 +0000 (12:42 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 5 Sep 2017 15:07:20 +0000 (17:07 +0200)
This quiets down complaints about the use of uninitialised memory

[extended tests]

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4340)

crypto/store/loader_file.c

index 1c794ef82630292053887a96bb6e83d1ec06add6..00d030217aa4bf0b3282295f77aa3a0b16ab857b 100644 (file)
@@ -855,7 +855,7 @@ static OSSL_STORE_LOADER_CTX *file_open(const OSSL_STORE_LOADER *loader,
         }
     } else {
         BIO *buff = NULL;
-        char peekbuf[4096];
+        char peekbuf[4096] = { 0, };
 
         if ((buff = BIO_new(BIO_f_buffer())) == NULL
             || (ctx->_.file.file = BIO_new_file(path, "rb")) == NULL) {