]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix Coverity 1503325 use after free
authorPauli <pauli@openssl.org>
Fri, 1 Apr 2022 01:20:26 +0000 (12:20 +1100)
committerPauli <pauli@openssl.org>
Fri, 6 May 2022 08:21:22 +0000 (18:21 +1000)
Another reference counting false positive, now negated.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/18014)

crypto/evp/evp_enc.c

index c31503e770ec7311a1250895246151e8a911bba3..a8f43b9b76ccd39a67b5840873b34293d1991b01 100644 (file)
@@ -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;