summaryrefslogtreecommitdiffstats
path: root/crypto/bio
diff options
context:
space:
mode:
authorndossche <niels.dossche@ugent.be>2023-02-03 13:43:03 +0100
committerTodd Short <todd.short@me.com>2023-02-08 09:35:19 -0500
commita811b6305b1f98e8ec66b8a426d359150fea69b2 (patch)
treed6c0c2e5508d3f108118123babbcde88467a81d9 /crypto/bio
parenta97ca33f83cc6201fe11d6c76a035c05dbaaf5bc (diff)
Fix incomplete error check on BIO_set_accept_name()
BIO_set_accept_name() can return error values -1 and 0 according to my analysis tool and the documentation. Documentation says a value of 1 indicates success. Currently, only an error value != 0 is checked which erroneously interprets a -1 error return value as success. Fix it by changing the check condition. CLA: trivial Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/20206)
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/bss_acpt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c
index 806186ae41..9514727cdf 100644
--- a/crypto/bio/bss_acpt.c
+++ b/crypto/bio/bss_acpt.c
@@ -568,7 +568,7 @@ BIO *BIO_new_accept(const char *str)
ret = BIO_new(BIO_s_accept());
if (ret == NULL)
return NULL;
- if (BIO_set_accept_name(ret, str))
+ if (BIO_set_accept_name(ret, str) > 0)
return ret;
BIO_free(ret);
return NULL;