From ff6c7cc60fcc5dad0b05c144a15b9af9ee3e7288 Mon Sep 17 00:00:00 2001 From: Pauli Date: Tue, 7 May 2019 11:06:33 +1000 Subject: [PATCH] Coverity CID 1444952: Null pointer dereferences Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/8888) --- crypto/evp/evp_enc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 44d88a1f04..4bc6370325 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -843,6 +843,10 @@ int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) legacy: *outl = 0; + if (ctx->cipher == NULL) { + EVPerr(EVP_F_EVP_DECRYPTFINAL_EX, EVP_R_NO_CIPHER_SET); + return 0; + } if (ctx->cipher->flags & EVP_CIPH_FLAG_CUSTOM_CIPHER) { i = ctx->cipher->do_cipher(ctx, out, NULL, 0); -- GitLab