]> 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>
Mon, 23 Sep 2024 20:16:51 +0000 (22:16 +0200)
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25010)

(cherry picked from commit 7ec5d5916bc8563935901c027fe56b6644787d10)

apps/lib/http_server.c

index 4bc2012a1edbe3431748a6f12af48539502f2374..dcb486037136ac12c318f4f9c611e5528317f04a 100644 (file)
@@ -202,8 +202,8 @@ BIO *http_server_init(const char *prog, const char *port, int verb)
         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_HTTP(prog, LOG_ERR, "error setting up accept BIO");
         goto err;
     }