summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/getaddrinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/net/getaddrinfo.c')
-rw-r--r--lib/libc/net/getaddrinfo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index d705028..ba61eb8 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -1275,7 +1275,8 @@ explore_numeric(const struct addrinfo *pai, const char *hostname,
* does not accept. So we need to separate the case for
* AF_INET.
*/
- if (inet_aton(hostname, (struct in_addr *)pton) != 1)
+ if (inet_aton(hostname, (struct in_addr *)pton) != 1 ||
+ hostname[strspn(hostname, "0123456789.xabcdefXABCDEF")] != '\0')
return 0;
p = pton;
break;
OpenPOWER on IntegriCloud