From: Pauli Date: Tue, 7 May 2019 00:18:29 +0000 (+1000) Subject: Coverity CID 1444963: Null pointer dereferences X-Git-Tag: openssl-3.0.0-alpha1~2094 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4894dcad6282985a96f5b3b560019c21c2bb3a6b;p=oweals%2Fopenssl.git Coverity CID 1444963: 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 d7ba7ddb85..a2f1260a90 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -620,7 +620,11 @@ int EVP_EncryptFinal_ex(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_ENCRYPTFINAL_EX, EVP_R_NO_CIPHER_SET); + return 0; + } + if (ctx->cipher->prov == NULL) goto legacy; blocksize = EVP_CIPHER_CTX_block_size(ctx);