From: Shane Lontis Date: Thu, 10 Sep 2020 07:30:02 +0000 (+1000) Subject: Fix coverity issue: CID 1466484 - Remove dead code in PKCS7_dataInit() X-Git-Tag: openssl-3.0.0-alpha7~295 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0f0b7dfbe5740da9e3fdf4753f8fb56301af13b7;p=thirdparty%2Fopenssl.git Fix coverity issue: CID 1466484 - Remove dead code in PKCS7_dataInit() Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/12847) --- diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c index 6a7af7826d4..c48c629398e 100644 --- a/crypto/pkcs7/pk7_doit.c +++ b/crypto/pkcs7/pk7_doit.c @@ -316,17 +316,12 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio) fetched_cipher = EVP_CIPHER_fetch(p7_ctx->libctx, EVP_CIPHER_name(evp_cipher), p7_ctx->propq); + (void)ERR_pop_to_mark(); if (fetched_cipher != NULL) cipher = fetched_cipher; else cipher = evp_cipher; - if (cipher == NULL) { - (void)ERR_clear_last_mark(); - goto err; - } - (void)ERR_pop_to_mark(); - if (EVP_CipherInit_ex(ctx, cipher, NULL, NULL, NULL, 1) <= 0) goto err;