]> git.ipfire.org Git - thirdparty/openssl.git/commit - crypto/evp/pmeth_lib.c
Fix double free in EVP_PKEY_CTX_dup()
authorslontis <shane.lontis@oracle.com>
Thu, 2 Sep 2021 06:39:21 +0000 (16:39 +1000)
committerTomas Mraz <tomas@openssl.org>
Fri, 3 Sep 2021 10:31:59 +0000 (12:31 +0200)
commit85407b77543a2d4330dbb40f6b8520ea0894a716
tree79891f58a905b7724ad6a5c1660bd59dc021ff9b
parent6f2f59944826b5b7e033af438f5831493d0362c9
Fix double free in EVP_PKEY_CTX_dup()

If the internal operations dupctx() fails then a free is done (e.g. EVP_KEYEXCH_free()). If this is not set to NULL the EVP_PKEY_CTX_free() will do a double free.
This was found by testing kdf_dupctx() in kdf_exch.c (Note this always
fails since the internal KDF's do not have a dup method).

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16495)
crypto/evp/pmeth_lib.c
test/evp_pkey_provided_test.c