diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2017-12-20 17:44:31 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2017-12-20 17:44:31 +0000 |
commit | 23e1a2d7dae369ecf1edd3e909823f42536014d0 (patch) | |
tree | 3fb1e8263f7edcca4a307ab290b76ad47f34a18f /lib | |
parent | 87879ba80552aaaa6fdb22fc06c86a180d657ee0 (diff) | |
download | src-23e1a2d7dae369ecf1edd3e909823f42536014d0.tar.gz src-23e1a2d7dae369ecf1edd3e909823f42536014d0.zip |
Don't ignore trailing spaces after numerical IP addresses.
PR: 224403
Reported by: Michael Kaufmann
Reviewed by: Michael Kaufmann
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=327029
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 4cdb2f2cc0d0..a33f240bc376 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -1277,7 +1277,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; |