diff options
| author | kenjiro <> | 2026-05-10 03:26:07 +0000 |
|---|---|---|
| committer | kenjiro <> | 2026-05-10 03:26:07 +0000 |
| commit | fd28299bd9759b8ac85b92d7103ceacc5db4701e (patch) | |
| tree | 55e6b407fb71edba3fb52c35e4d4ba338bef8424 /src/usr.bin/openssl | |
| parent | 6556707fc13e07921f7e60bc526c07638b6200fd (diff) | |
| download | openbsd-fd28299bd9759b8ac85b92d7103ceacc5db4701e.tar.gz openbsd-fd28299bd9759b8ac85b92d7103ceacc5db4701e.tar.bz2 openbsd-fd28299bd9759b8ac85b92d7103ceacc5db4701e.zip | |
openssl s_socket: do not fail accept on reverse DNS lookup failure
Found by Frank Denis
Diffstat (limited to 'src/usr.bin/openssl')
| -rw-r--r-- | src/usr.bin/openssl/s_socket.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/usr.bin/openssl/s_socket.c b/src/usr.bin/openssl/s_socket.c index 86a23c56d1..a479eac06a 100644 --- a/src/usr.bin/openssl/s_socket.c +++ b/src/usr.bin/openssl/s_socket.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: s_socket.c,v 1.14 2025/01/02 13:10:03 tb Exp $ */ | 1 | /* $OpenBSD: s_socket.c,v 1.15 2026/05/10 03:26:07 kenjiro Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -260,15 +260,8 @@ do_accept(int acc_sock, int *sock) | |||
| 260 | h2 = gethostbyname(host); | 260 | h2 = gethostbyname(host); |
| 261 | if (h2 == NULL) { | 261 | if (h2 == NULL) { |
| 262 | BIO_printf(bio_err, "gethostbyname failure\n"); | 262 | BIO_printf(bio_err, "gethostbyname failure\n"); |
| 263 | close(ret); | 263 | } else if (h2->h_addrtype != AF_INET) { |
| 264 | free(host); | ||
| 265 | return (0); | ||
| 266 | } | ||
| 267 | if (h2->h_addrtype != AF_INET) { | ||
| 268 | BIO_printf(bio_err, "gethostbyname addr is not AF_INET\n"); | 264 | BIO_printf(bio_err, "gethostbyname addr is not AF_INET\n"); |
| 269 | close(ret); | ||
| 270 | free(host); | ||
| 271 | return (0); | ||
| 272 | } | 265 | } |
| 273 | } | 266 | } |
| 274 | 267 | ||
