diff options
author | ndossche <niels.dossche@ugent.be> | 2023-02-02 14:02:34 +0100 |
---|---|---|
committer | Todd Short <todd.short@me.com> | 2023-02-08 11:01:39 -0500 |
commit | cf3cf2ba81f803f283f40ff93cb19d2b8142dacd (patch) | |
tree | 070da37ff8f4fc76e03c03035dfdbc04db9095af /crypto | |
parent | a5a3532ab0e330351861bb2e00619ec455f3d414 (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)
(cherry picked from commit 89601c72471a4b6bbb9e877f5c54f20eceba5f01)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/bio/bio_lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c index 3a7e41534f..9469050331 100644 --- a/crypto/bio/bio_lib.c +++ b/crypto/bio/bio_lib.c @@ -784,7 +784,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; } |