From 89601c72471a4b6bbb9e877f5c54f20eceba5f01 Mon Sep 17 00:00:00 2001 From: ndossche Date: Thu, 2 Feb 2023 14:02:34 +0100 Subject: 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 Reviewed-by: Tomas Mraz Reviewed-by: Todd Short (Merged from https://github.com/openssl/openssl/pull/20194) --- crypto/bio/bio_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crypto') 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; } -- cgit v1.2.3