From: David von Oheimb Date: Wed, 31 Jul 2024 17:32:44 +0000 (+0200) Subject: http_server.c: fix checks of error return code in http_server_init() X-Git-Tag: openssl-3.1.8~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c61b3ae4221bc82bf880ac9702f9c5f30da1a17e;p=thirdparty%2Fopenssl.git http_server.c: fix checks of error return code in http_server_init() Reviewed-by: Viktor Dukhovni Reviewed-by: Tomas Mraz Reviewed-by: Neil Horman Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/25533) (cherry picked from commit 755dca7b02cab01c228cd4ace3a254fec0a055eb) --- diff --git a/apps/lib/http_server.c b/apps/lib/http_server.c index 535c1408963..120a5d3c874 100644 --- a/apps/lib/http_server.c +++ b/apps/lib/http_server.c @@ -228,8 +228,8 @@ BIO *http_server_init_bio(const char *prog, const char *port) goto err; acbio = BIO_new(BIO_s_accept()); if (acbio == NULL - || BIO_set_bind_mode(acbio, BIO_BIND_REUSEADDR) < 0 - || BIO_set_accept_name(acbio, name) < 0) { + || BIO_set_bind_mode(acbio, BIO_BIND_REUSEADDR) <= 0 + || BIO_set_accept_name(acbio, name) <= 0) { log_message(prog, LOG_ERR, "Error setting up accept BIO"); goto err; }