Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Dec 2017 17:44:31 +0000 (UTC)
From:      Hajimu UMEMOTO <ume@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r327029 - head/lib/libc/net
Message-ID:  <201712201744.vBKHiVLY050015@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712201744.vBKHiVLY050015>