openssl/crypto/asn1
Oliver Mihatsch 3a1d2b5952 Fix memory leak in i2d_ASN1_bio_stream
When creating a signed S/MIME message using SMIME_write_CMS()
if the reading from the bio fails, the state is therefore
still ASN1_STATE_START when BIO_flush() is called by i2d_ASN1_bio_stream().
This results in calling asn1_bio_flush_ex cleanup but will only
reset retry flags as the state is not ASN1_STATE_POST_COPY.
Therefore 48 bytes (Linux x86_64) leaked since the
ndef_prefix_free / ndef_suffix_free callbacks are not executed
and the ndef_aux structure is not freed.

By always calling free function callback in asn1_bio_free() the
memory leak is fixed.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14844)
2021-07-02 16:17:11 +02:00
..
a_bitstr.c
a_d2i_fp.c Teach more of the ASN.1 code about libctx/propq 2021-06-05 17:39:10 +10:00
a_digest.c
a_dup.c Give ASN.1 objects the ability to report their libctx/propq 2021-06-05 17:39:27 +10:00
a_gentm.c
a_i2d_fp.c
a_int.c
a_mbstr.c
a_object.c
a_octet.c
a_print.c
a_sign.c
a_strex.c
a_strnid.c
a_time.c Add support for ISO 8601 datetime format 2021-06-11 12:39:46 +02:00
a_type.c
a_utctm.c
a_utf8.c
a_verify.c Update copyright year 2021-06-17 13:24:59 +01:00
ameth_lib.c
asn1_err.c
asn1_gen.c
asn1_item_list.c
asn1_item_list.h
asn1_lib.c ossl_sk_ASN1_UTF8STRING2text(): Minor generalization and refactoring for readability 2021-06-25 07:44:50 +02:00
asn1_local.h Teach more of the ASN.1 code about libctx/propq 2021-06-05 17:39:10 +10:00
asn1_parse.c asn1: properly clean up on failed BIO creation 2021-06-22 12:43:21 +10:00
asn_mime.c Teach more of the ASN.1 code about libctx/propq 2021-06-05 17:39:10 +10:00
asn_moid.c
asn_mstbl.c
asn_pack.c
bio_asn1.c Fix memory leak in i2d_ASN1_bio_stream 2021-07-02 16:17:11 +02:00
bio_ndef.c Fix memory leak in i2d_ASN1_bio_stream 2021-07-02 16:17:11 +02:00
build.info ASN1: rename asn1_par.c to asn1_parse.c for clarity; simplify asn1_parse2() 2021-06-15 14:23:21 +02:00
charmap.h
charmap.pl
d2i_param.c Update copyright year 2021-06-17 13:24:59 +01:00
d2i_pr.c Decoding PKCS#8: separate decoding of encrypted and unencrypted PKCS#8 2021-06-09 17:00:10 +02:00
d2i_pu.c Update copyright year 2021-06-17 13:24:59 +01:00
evp_asn1.c
f_int.c
f_string.c
i2d_evp.c Decoding PKCS#8: separate decoding of encrypted and unencrypted PKCS#8 2021-06-09 17:00:10 +02:00
n_pkey.c Update copyright year 2021-06-17 13:24:59 +01:00
nsseq.c
p5_pbe.c
p5_pbev2.c
p5_scrypt.c
p8_pkey.c
standard_methods.h
t_bitst.c
t_pkey.c
t_spki.c
tasn_dec.c Teach more of the ASN.1 code about libctx/propq 2021-06-05 17:39:10 +10:00
tasn_enc.c
tasn_fre.c
tasn_new.c Teach more of the ASN.1 code about libctx/propq 2021-06-05 17:39:10 +10:00
tasn_prn.c
tasn_scn.c
tasn_typ.c
tasn_utl.c
tbl_standard.h
x_algor.c asn1: fix indentation 2021-06-19 15:54:06 +10:00
x_bignum.c
x_info.c
x_int64.c
x_long.c
x_pkey.c
x_sig.c
x_spki.c
x_val.c