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)
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;