summaryrefslogtreecommitdiffstats
path: root/crypto/bio
diff options
context:
space:
mode:
authorndossche <niels.dossche@ugent.be>2023-02-02 14:02:34 +0100
committerTodd Short <todd.short@me.com>2023-02-08 10:58:47 -0500
commit89601c72471a4b6bbb9e877f5c54f20eceba5f01 (patch)
treed3ccd493ebd30616bec283587250f20c4438f682 /crypto/bio
parentba061818e9d76f332e8914dfe9168577b2378dde (diff)
Fix incomplete BIO_dup_state() error check
BIO_dup_state() returns an error code <= 0 according to my analysis tool and the documentation. Currently only == 0 is checked. Fix it by changing the check condition. CLA: trivial Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/20194)
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/bio_lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c
index 4708b984fa..2848d55934 100644
--- a/crypto/bio/bio_lib.c
+++ b/crypto/bio/bio_lib.c
@@ -886,7 +886,7 @@ BIO *BIO_dup_chain(BIO *in)
/* This will let SSL_s_sock() work with stdin/stdout */
new_bio->num = bio->num;
- if (!BIO_dup_state(bio, (char *)new_bio)) {
+ if (BIO_dup_state(bio, (char *)new_bio) <= 0) {
BIO_free(new_bio);
goto err;
}