From: Pauli Date: Fri, 1 Apr 2022 01:20:26 +0000 (+1100) Subject: Fix Coverity 1503325 use after free X-Git-Tag: openssl-3.2.0-alpha1~2694 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71b7f34978c7332562300487af497559b67f600a;p=thirdparty%2Fopenssl.git Fix Coverity 1503325 use after free Another reference counting false positive, now negated. Reviewed-by: Tomas Mraz Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/18014) --- diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index c31503e770e..a8f43b9b76c 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -202,6 +202,8 @@ static int evp_cipher_init_internal(EVP_CIPHER_CTX *ctx, return 0; } EVP_CIPHER_free(ctx->fetched_cipher); + /* Coverity false positive, the reference counting is confusing it */ + /* coverity[use_after_free] */ ctx->fetched_cipher = (EVP_CIPHER *)cipher; } ctx->cipher = cipher;