]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
http_server.c: fix checks of error return code in http_server_init()
authorDavid von Oheimb <dev@ddvo.net>
Wed, 31 Jul 2024 17:32:44 +0000 (19:32 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 26 Sep 2024 08:00:14 +0000 (10:00 +0200)
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/25533)

(cherry picked from commit 755dca7b02cab01c228cd4ace3a254fec0a055eb)

apps/lib/http_server.c

index 535c1408963da825bc460f292f3dc339241e2024..120a5d3c87404407a9c7e2325fa802bce86a565a 100644 (file)
@@ -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;
     }