diff options
Diffstat (limited to 'src/platform')
| -rw-r--r-- | src/platform/posix/posix_resolv_gai.c | 9 | ||||
| -rw-r--r-- | src/platform/windows/win_resolv.c | 10 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/platform/posix/posix_resolv_gai.c b/src/platform/posix/posix_resolv_gai.c index 7a0f8e1f..c26657e9 100644 --- a/src/platform/posix/posix_resolv_gai.c +++ b/src/platform/posix/posix_resolv_gai.c @@ -230,9 +230,12 @@ nni_resolv_ip(const char *host, uint16_t port, int af, bool passive, if (nni_aio_begin(aio) != 0) { return; } - if (host != NULL && strlen(host) >= sizeof(item->host)) { - nni_aio_finish_error(aio, NNG_EADDRINVAL); - return; + if (host != NULL) { + if ((strlen(host) >= sizeof(item->host)) || + (strcmp(host, "*") == 0)) { + nni_aio_finish_error(aio, NNG_EADDRINVAL); + return; + } } switch (af) { case NNG_AF_INET: diff --git a/src/platform/windows/win_resolv.c b/src/platform/windows/win_resolv.c index ece14655..f9e5e1f6 100644 --- a/src/platform/windows/win_resolv.c +++ b/src/platform/windows/win_resolv.c @@ -190,11 +190,13 @@ nni_resolv_ip(const char *host, uint16_t port, int family, bool passive, if (nni_aio_begin(aio) != 0) { return; } - if (host != NULL && strlen(host) >= sizeof(item->host)) { - nni_aio_finish_error(aio, NNG_EADDRINVAL); - return; + if (host != NULL) { + if ((strlen(host) >= sizeof(item->host)) || + (strcmp(host, "*") == 0)) { + nni_aio_finish_error(aio, NNG_EADDRINVAL); + return; + } } - switch (family) { case NNG_AF_INET: fam = AF_INET; |
