From: Pauli Date: Tue, 7 May 2019 01:06:33 +0000 (+1000) Subject: Coverity CID 1444952: Null pointer dereferences X-Git-Tag: openssl-3.0.0-alpha1~2084 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ff6c7cc60fcc5dad0b05c144a15b9af9ee3e7288;p=oweals%2Fopenssl.git Coverity CID 1444952: Null pointer dereferences Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/8888) --- 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);