openssl/crypto/pkcs7
Bernd Edlinger 82a13a1f50 Fix possible double-free in pkcs7 add_attribute function
The problem is the ownership of the input parameter value
is transfered to the X509_ATTRIBUTE object attr, as soon
as X509_ATTRIBUTE_create succeeds, but when an error happens
after that point there is no way to get the ownership back
to the caller, which is necessary to fullfill the API contract.

Fixed that by moving the call to X509_ATTRIBUTE_create to the
end of the function, and make sure that no errors are possible
after that point.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22721)
2024-07-08 12:25:45 +02:00
..
bio_pk7.c
build.info
pk7_asn1.c
pk7_attr.c Fix possible memleak in PKCS7_add0_attrib_signing_time 2023-11-22 09:49:02 +01:00
pk7_doit.c Fix possible double-free in pkcs7 add_attribute function 2024-07-08 12:25:45 +02:00
pk7_lib.c
pk7_local.h
pk7_mime.c Copyright year updates 2024-04-09 13:43:26 +02:00
pk7_smime.c Copyright year updates 2024-04-09 13:43:26 +02:00
pkcs7err.c