Avoid infinite loop in bio_asn1 state machine
authortb <tb@openbsd.org>
Sat, 4 Mar 2023 11:58:29 +0000 (11:58 +0000)
committertb <tb@openbsd.org>
Sat, 4 Mar 2023 11:58:29 +0000 (11:58 +0000)
commite31c4e693ad7f615fef319f9a8fd904b868e4995
tree423d805a289613e11a8802cc0ac549d224057d6e
parent58feb3ffc6e4325f32e45913d0699eeb367a8a88
Avoid infinite loop in bio_asn1 state machine

If the BIO_write() in the ASN1_STATE_DATA_COPY state fails, incorrect
error handling will break out of the switch without changing the state,
and the infinite for loop will immediately try the same write again,
which is unlikely to succeed... Clearly this code intended to break out
of the loop instead.

Via OpenSSL 1.1 commit 723f616df81ea05f31407f7417f49eea89bb459a

ok millert
lib/libcrypto/asn1/bio_asn1.c