]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix Memory leak in CMS_EncryptedData_set1_key
authorRyan Hooper <ryhooper@cisco.com>
Thu, 25 Sep 2025 16:42:24 +0000 (12:42 -0400)
committerTomas Mraz <tomas@openssl.org>
Wed, 1 Oct 2025 15:48:54 +0000 (17:48 +0200)
commit7de825efa26d136c7bb118156190437bdcf130b7
treea46a2481719326baada16a853e98031f336a5e11
parent26e2c9c15085e0a6afe0f878ec3c9a0f4d0047a3
Fix Memory leak in CMS_EncryptedData_set1_key

When CMS_EncryptedData_set1_key is called repeatedly it will
leak data on the second call. This was because
cms->d.encryptedData was already set and needed to be cleared
before the call to M_ASN1_new_of.

Fixes: #28606
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28668)
crypto/cms/cms_enc.c
test/cmsapitest.c