Avoid recycling ASN1_STRINGs when decoding ASN.1.
authorjsing <jsing@openbsd.org>
Sat, 3 Sep 2022 19:11:45 +0000 (19:11 +0000)
committerjsing <jsing@openbsd.org>
Sat, 3 Sep 2022 19:11:45 +0000 (19:11 +0000)
commitbf2d4bd91424158946f37dbdfea4fa0c27ef7adb
tree855e9bc8a6ad01bf6a5ca6923b1655c1a0d6387f
parent64cf32f94cef382475d12c06f1ba386013c374f2
Avoid recycling ASN1_STRINGs when decoding ASN.1.

Rather than recycling an existing ASN1_STRING and changing its type, free
it and allocate a replacement. This simplifies the code and potentially
avoids bugs resulting from reuse.

ok tb@
lib/libcrypto/asn1/tasn_dec.c