summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2023-03-04 11:58:29 +0000
committertb <>2023-03-04 11:58:29 +0000
commit4ccd3183f94270b404e8fb1737aa39fb523abf31 (patch)
tree7a557b2419c7fd6db0d9f7ae3a87a56dbb91e2bc /src
parent69faacd992fce32cb8d30f38074d008f457a4de9 (diff)
downloadopenbsd-4ccd3183f94270b404e8fb1737aa39fb523abf31.tar.gz
openbsd-4ccd3183f94270b404e8fb1737aa39fb523abf31.tar.bz2
openbsd-4ccd3183f94270b404e8fb1737aa39fb523abf31.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/asn1/bio_asn1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/asn1/bio_asn1.c b/src/lib/libcrypto/asn1/bio_asn1.c
index 9017786f1f..05bc1f7ad3 100644
--- a/src/lib/libcrypto/asn1/bio_asn1.c
+++ b/src/lib/libcrypto/asn1/bio_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_asn1.c,v 1.17 2022/01/14 08:40:57 tb Exp $ */ 1/* $OpenBSD: bio_asn1.c,v 1.18 2023/03/04 11:58:29 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project. 3 * project.
4 */ 4 */
@@ -254,7 +254,7 @@ asn1_bio_write(BIO *b, const char *in , int inl)
254 wrmax = inl; 254 wrmax = inl;
255 ret = BIO_write(b->next_bio, in, wrmax); 255 ret = BIO_write(b->next_bio, in, wrmax);
256 if (ret <= 0) 256 if (ret <= 0)
257 break; 257 goto done;
258 wrlen += ret; 258 wrlen += ret;
259 ctx->copylen -= ret; 259 ctx->copylen -= ret;
260 in += ret; 260 in += ret;