svn commit: r327029 - head/lib/libc/net
Hajimu UMEMOTO
ume at FreeBSD.org
Wed Dec 20 17:44:32 UTC 2017
Author: ume
Date: Wed Dec 20 17:44:31 2017
New Revision: 327029
URL: https://svnweb.freebsd.org/changeset/base/327029
Log:
Don't ignore trailing spaces after numerical IP addresses.
PR: 224403
Reported by: Michael Kaufmann
Reviewed by: Michael Kaufmann
MFC after: 1 week
Modified:
head/lib/libc/net/getaddrinfo.c
Modified: head/lib/libc/net/getaddrinfo.c
==============================================================================
--- head/lib/libc/net/getaddrinfo.c Wed Dec 20 16:49:45 2017 (r327028)
+++ head/lib/libc/net/getaddrinfo.c Wed Dec 20 17:44:31 2017 (r327029)
@@ -1277,7 +1277,8 @@ explore_numeric(const struct addrinfo *pai, const char
* 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;
More information about the svn-src-all
mailing list