Don't ignore trailing spaces after numerical IP addresses.

PR:		224403
Reported by:	Michael Kaufmann
Reviewed by:	Michael Kaufmann
MFC after:	1 week
This commit is contained in:
ume 2017-12-20 17:44:31 +00:00
parent 89abf1f0c0
commit 156cfa4de4

View File

@ -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;