diff options
Diffstat (limited to 'src/lib/libcrypto/bio/b_sock.c')
| -rw-r--r-- | src/lib/libcrypto/bio/b_sock.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/libcrypto/bio/b_sock.c b/src/lib/libcrypto/bio/b_sock.c index cfa48c6860..152b080902 100644 --- a/src/lib/libcrypto/bio/b_sock.c +++ b/src/lib/libcrypto/bio/b_sock.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: b_sock.c,v 1.68 2018/02/06 14:45:52 bluhm Exp $ */ | 1 | /* $OpenBSD: b_sock.c,v 1.69 2018/02/07 00:52:05 bluhm Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2017 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2017 Bob Beck <beck@openbsd.org> |
| 4 | * | 4 | * |
| @@ -134,16 +134,18 @@ BIO_get_accept_socket(char *host, int bind_mode) | |||
| 134 | p = NULL; | 134 | p = NULL; |
| 135 | h = str; | 135 | h = str; |
| 136 | if ((p = strrchr(str, ':')) == NULL) { | 136 | if ((p = strrchr(str, ':')) == NULL) { |
| 137 | BIOerror(BIO_R_NO_PORT_SPECIFIED); | 137 | /* A string without a colon is treated as a port. */ |
| 138 | goto err; | 138 | p = str; |
| 139 | } | ||
| 140 | *p++ = '\0'; | ||
| 141 | if (*p == '\0') { | ||
| 142 | BIOerror(BIO_R_NO_PORT_SPECIFIED); | ||
| 143 | goto err; | ||
| 144 | } | ||
| 145 | if (*h == '\0' || strcmp(h, "*") == 0) | ||
| 146 | h = NULL; | 139 | h = NULL; |
| 140 | } else { | ||
| 141 | *p++ = '\0'; | ||
| 142 | if (*p == '\0') { | ||
| 143 | BIOerror(BIO_R_NO_PORT_SPECIFIED); | ||
| 144 | goto err; | ||
| 145 | } | ||
| 146 | if (*h == '\0' || strcmp(h, "*") == 0) | ||
| 147 | h = NULL; | ||
| 148 | } | ||
| 147 | 149 | ||
| 148 | if ((error = getaddrinfo(h, p, &hints, &res)) != 0) { | 150 | if ((error = getaddrinfo(h, p, &hints, &res)) != 0) { |
| 149 | ERR_asprintf_error_data("getaddrinfo: '%s:%s': %s'", h, p, | 151 | ERR_asprintf_error_data("getaddrinfo: '%s:%s': %s'", h, p, |
