From ca6cfe359fa55a5a7f4b6ae73500ffd98e6ee968 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 18 Nov 2024 01:17:24 -0800 Subject: URL refactor part 1. This eliminates most (but not all) of the dynamic allocations associated with URL objects. A number of convenience fields on the URL are removed, but we are able to use common buffer for most of the details. --- src/platform/posix/posix_resolv_gai.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/platform/posix') 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: -- cgit v1.2.3-70-g09d2