svn commit: r322669 - head/lib/libfetch

Dag-Erling Smørgrav des at FreeBSD.org
Fri Aug 18 18:20:37 UTC 2017


Author: des
Date: Fri Aug 18 18:20:36 2017
New Revision: 322669
URL: https://svnweb.freebsd.org/changeset/base/322669

Log:
  In fetch_resolve(), if the port number or service name is included in
  the host argument (e.g. "www.freebsd.org:443"), the service pointer,
  which is supposed to point to the port or service part, instead points
  to the separator, causing getaddrinfo() to fail.
  
  Note that I have not been able to trigger this bug with fetch(1), nor
  do I believe it is possible, as libfetch always parses the host:port
  specification itself.  I discovered it when I copied fetch_resolve()
  into an unrelated project.
  
  MFC after:	3 days

Modified:
  head/lib/libfetch/common.c

Modified: head/lib/libfetch/common.c
==============================================================================
--- head/lib/libfetch/common.c	Fri Aug 18 17:32:14 2017	(r322668)
+++ head/lib/libfetch/common.c	Fri Aug 18 18:20:36 2017	(r322669)
@@ -291,7 +291,7 @@ fetch_resolve(const char *addr, int port, int af)
 			goto syserr;
 		service = sbuf;
 	} else if (*sep != '\0') {
-		service = sep;
+		service = sep + 1;
 	} else {
 		service = NULL;
 	}


More information about the svn-src-head mailing list