From d2c2e49eab69c7446c1c2c7227f63f8618ca99a5 Mon Sep 17 00:00:00 2001 From: Pauli Date: Tue, 7 May 2019 10:48:42 +1000 Subject: [PATCH] Coverity CID 1444958: Null pointer dereferences Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/8888) --- crypto/evp/evp_enc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index a2f1260a90..1eb894b87f 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -699,7 +699,11 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, return 0; } - if (ctx->cipher == NULL || ctx->cipher->prov == NULL) + if (ctx->cipher == NULL) { + EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_NO_CIPHER_SET); + return 0; + } + if (ctx->cipher->prov == NULL) goto legacy; blocksize = EVP_CIPHER_CTX_block_size(ctx); -- 2.25.1