From owner-svn-src-all@freebsd.org Fri Aug 18 18:20:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5F24DCC610; Fri, 18 Aug 2017 18:20:37 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 953706F7D3; Fri, 18 Aug 2017 18:20:37 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7IIKaXL061067; Fri, 18 Aug 2017 18:20:36 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7IIKaFv061066; Fri, 18 Aug 2017 18:20:36 GMT (envelope-from des@FreeBSD.org) Message-Id: <201708181820.v7IIKaFv061066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 18 Aug 2017 18:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322669 - head/lib/libfetch X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: head/lib/libfetch X-SVN-Commit-Revision: 322669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2017 18:20:37 -0000 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; }