openssl/crypto/asn1
Paul Dreik 0760d132da Avoid invoking memcpy if size is zero or the supplied buffer is NULL
This allows for passing a NULL pointer with zero max_len.

Invoking memcpy on NULL is undefined behaviour, even if the size is zero.

https://en.cppreference.com/w/c/string/byte/memcpy

The function can now be queried for the necessary buffer length.

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10541)
2021-08-25 17:02:37 +02:00
..
a_bitstr.c Update copyright year 2021-04-08 13:04:41 +01:00
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 Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
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 Update copyright year 2021-04-08 13:04:41 +01:00
a_i2d_fp.c Update copyright year 2021-05-20 14:22:33 +01:00
a_int.c Add more negative checks for integers passed to OPENSSL_malloc(). 2021-04-16 12:10:08 +10:00
a_mbstr.c Add more negative checks for integers passed to OPENSSL_malloc(). 2021-04-16 12:10:08 +10:00
a_object.c ASN1: Ensure that d2i_ASN1_OBJECT() frees the strings on ASN1_OBJECT reuse 2021-04-27 12:43:52 +02:00
a_octet.c
a_print.c
a_sign.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
a_strex.c check i2d_ASN1_TYPE return value 2021-05-14 10:13:53 +10:00
a_strnid.c
a_time.c Add support for ISO 8601 datetime format 2021-06-11 12:39:46 +02:00
a_type.c Update copyright year 2021-04-08 13:04:41 +01:00
a_utctm.c Update copyright year 2021-04-08 13:04:41 +01:00
a_utf8.c
a_verify.c Update copyright year 2021-06-17 13:24:59 +01:00
ameth_lib.c Update copyright year 2021-04-22 14:38:44 +01:00
asn1_err.c err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
asn1_gen.c Update copyright year 2021-05-20 14:22:33 +01:00
asn1_item_list.c
asn1_item_list.h
asn1_lib.c Allow fuzz builds to detect string overruns 2021-08-24 14:22:07 +01: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 Add a local perl module to get year last changed 2021-03-31 13:59:53 +02:00
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 Avoid invoking memcpy if size is zero or the supplied buffer is NULL 2021-08-25 17:02:37 +02:00
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 add zero strenght arguments to BN and RAND RNG calls 2021-05-29 17:17:12 +10:00
p5_pbev2.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
p5_scrypt.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
p8_pkey.c
standard_methods.h Update copyright year 2021-04-08 13:04:41 +01:00
t_bitst.c
t_pkey.c
t_spki.c Fix NETSCAPE_SPKI_print function to not assume NUL terminated strings 2021-08-24 14:22:06 +01:00
tasn_dec.c Teach more of the ASN.1 code about libctx/propq 2021-06-05 17:39:10 +10:00
tasn_enc.c asn.1: fix Coverity 1487104 Logically dead code 2021-07-13 09:24:04 +10:00
tasn_fre.c Update copyright year 2021-04-08 13:04:41 +01:00
tasn_new.c Teach more of the ASN.1 code about libctx/propq 2021-06-05 17:39:10 +10:00
tasn_prn.c Update copyright year 2021-04-08 13:04:41 +01:00
tasn_scn.c
tasn_typ.c
tasn_utl.c Rework and make DEBUG macros consistent. 2021-05-28 10:04:31 +02:00
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 Update copyright year 2021-04-08 13:04:41 +01:00
x_long.c
x_pkey.c
x_sig.c
x_spki.c
x_val.c