diff options
author | ume <ume@FreeBSD.org> | 2017-12-27 14:50:07 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2017-12-27 14:50:07 +0000 |
commit | 7d34998b563823895d737f1850977adf42ebb9a0 (patch) | |
tree | 1390540ef4cbcd1b5b661b193a0103a3cc605e17 /lib | |
parent | ed596e7fc294f704796e96377235d77adb7bee0e (diff) | |
download | FreeBSD-src-7d34998b563823895d737f1850977adf42ebb9a0.zip FreeBSD-src-7d34998b563823895d737f1850977adf42ebb9a0.tar.gz |
MFC r327029:
Don't ignore trailing spaces after numerical IP addresses.
PR: 224403
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/net/getaddrinfo.c | 3 |
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; |