]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
bio_sock: fix inverted BIO_lookup return value check
authorJoshua Rogers <MegaManSec@users.noreply.github.com>
Sat, 11 Oct 2025 06:43:39 +0000 (14:43 +0800)
committerTomas Mraz <tomas@openssl.org>
Fri, 17 Oct 2025 17:27:17 +0000 (19:27 +0200)
Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28862)

(cherry picked from commit 1c1dcfc269c35e3f8fdbc72b78378aac90a61a81)

crypto/bio/bio_sock.c

index be1a74620f69760424d4e8b4f5171645aea62c1f..7271a14012b9fffe85789192676a132c65cf0570 100644 (file)
@@ -261,7 +261,7 @@ int BIO_get_accept_socket(char *host, int bind_mode)
     if (BIO_sock_init() != 1)
         goto err;
 
-    if (BIO_lookup(h, p, BIO_LOOKUP_SERVER, AF_UNSPEC, SOCK_STREAM, &res) != 0)
+    if (BIO_lookup(h, p, BIO_LOOKUP_SERVER, AF_UNSPEC, SOCK_STREAM, &res) == 0)
         goto err;
 
     if ((s = BIO_socket(BIO_ADDRINFO_family(res), BIO_ADDRINFO_socktype(res),