Factor out ASN1_STRING clearing code.
authorjsing <jsing@openbsd.org>
Mon, 14 Mar 2022 16:35:45 +0000 (16:35 +0000)
committerjsing <jsing@openbsd.org>
Mon, 14 Mar 2022 16:35:45 +0000 (16:35 +0000)
commit31b410a6e73670311b1214e0b7f9ae426880f048
treeca16cf33d5737356421901f08ae7522a35c6113e
parent89827a00677042cffb980c36aa2f3eb8efb682de
Factor out ASN1_STRING clearing code.

This fixes a bug in ASN1_STRING_set0() where it does not respect the
ASN1_STRING_FLAG_NDEF flag and potentially frees memory that we do not own.

ok inguchi@ tb@
lib/libcrypto/asn1/a_string.c