From: Pauli Date: Tue, 7 May 2019 00:48:42 +0000 (+1000) Subject: Coverity CID 1444958: Null pointer dereferences X-Git-Tag: openssl-3.0.0-alpha1~2090 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d2c2e49eab69c7446c1c2c7227f63f8618ca99a5;p=oweals%2Fopenssl.git Coverity CID 1444958: 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 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);