From 1702c500b58414a936ce139853620b57547e6a0c Mon Sep 17 00:00:00 2001 From: Pauli Date: Tue, 7 May 2019 11:04:37 +1000 Subject: [PATCH] Coverity CID 1444953: Null pointer dereferences Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/8888) --- crypto/evp/evp_enc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 0ccea3599e..44d88a1f04 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -338,6 +338,9 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, #ifndef OPENSSL_NO_ENGINE skip_to_init: #endif + if (ctx->cipher == NULL) + return 0; + /* we assume block size is a power of 2 in *cryptUpdate */ OPENSSL_assert(ctx->cipher->block_size == 1 || ctx->cipher->block_size == 8 -- 2.50.1