diff options
author | ndossche <niels.dossche@ugent.be> | 2023-02-03 13:43:03 +0100 |
---|---|---|
committer | Todd Short <todd.short@me.com> | 2023-02-08 09:39:34 -0500 |
commit | 510e4935ca728cf91820edcec55afb8e1f6aa5a2 (patch) | |
tree | 99ca53d4ffab9d8c62affc51094ce7d5da6e5a36 /crypto | |
parent | 2175054e3201c2351550c76b58b9d62b0434133f (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)
(cherry picked from commit a811b6305b1f98e8ec66b8a426d359150fea69b2)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/bio/bss_acpt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c index 2a8e871ba1..681813a1b4 100644 --- a/crypto/bio/bss_acpt.c +++ b/crypto/bio/bss_acpt.c @@ -566,7 +566,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; |