From nobody Mon Mar 25 20:14:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4V3PKZ2LWCz4nyjs; Mon, 25 Mar 2024 20:14:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V3PKZ1qVZz3x6P; Mon, 25 Mar 2024 20:14:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711397666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qF8pdhSrve0j3zZ2Z/0nb41F/LOAWBBLjdGi4wSVSyU=; b=Wm0Fg+4sA7zgOYI7EYF9KtJ5Gi5O+OyVxyh7n6LSS51kpkYhfSjqriEORQnTLtbUF3R1Vh 39IZl+WIG1IW2ye5M9p03LGetxS7/BF8ZUJpxL5wYBU3GFgVZ+v/kIInczwiC5NxmYparf AkDbkYGMtTW7JfVVvonTrKzL622rtmQtFFyNVU6Cr+fyKIj9iXSM3ak6OPPtO9n4R9S/KD vz/quVaC8Hgqqv3KZCa2RUd6s7P5K20VSII5/K7c7GbF/DnYg5pN+sujTBz+ypypGGcwUr iu3fXG9qQxBeo0rsxNagnHHs34jBecdGTG1soIwrTr5xnL9N+OyG0HCNG5W0XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711397666; a=rsa-sha256; cv=none; b=UUrTnYi89rMDzcnru8PWEoQ6wzTZQlG4WVGkF1AJlpCo6VvQzRTFn2JfPdaFySdXt34wqo N52iTncRjWRlEiZEotPHIMMFbkPjkEZHPf5guaSrQSh568rhq/0tjDtlRRlUe6c90CbqFF htfIpAv5v8sIzcsZZH+9o6ldJ3nuxHkpl3+ACM+Hq0Ae+ymOUm9DcEud6yatYyNKEQTPMi nE2I/AR1tpkc2U5ubzKDwyDc7yumYq1fHN9vJUW0GEawbDZYXr5Ede+GOnSmVo3AD/YpLb BMON+5XSA8hvOghY+MiPKpFKTpe3ny+pmlbsYhJqgnTcI0LyPEmY6eaDS4xVQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711397666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qF8pdhSrve0j3zZ2Z/0nb41F/LOAWBBLjdGi4wSVSyU=; b=dI4tfsNwE0XOImBWQ6DCUFeCBePguVKXbuU9nzHxlp21oC4KVjnxhKfdquE1rpQyxZYfhG 4Urypnwd1Us/PFtbqpyXP8allzf0HgYnZU+naUSWZaA30IQjliXJlSWUECHohtLAtZso1k ptc+3yKDBxhRP3Y13KgYwmzf0TSyo+x0Xd7dPMbrQj/xxs+97LbMSO//kjFx2qH2kxFGEp 7siV2Q/JmOcNheb8RYQ2OsWm51fXMkr3FopKnoY/ryRMeBtXiQw9vcf8D/BWiheNk2RmHj Ns1DrzR2+Z/O27uw3+qPuqNHGiO3eAZFrHujlHxji945Ve111vn8av2q15q08A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4V3PKZ1R1WzWkf; Mon, 25 Mar 2024 20:14:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42PKEQY4023473; Mon, 25 Mar 2024 20:14:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42PKEQEf023470; Mon, 25 Mar 2024 20:14:26 GMT (envelope-from git) Date: Mon, 25 Mar 2024 20:14:26 GMT Message-Id: <202403252014.42PKEQEf023470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: fb860ed0c52c - main - libfetch: parse scheme://domain:/ correctly List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb860ed0c52c2c1e7792ef86718620a439663c7f Auto-Submitted: auto-generated The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=fb860ed0c52c2c1e7792ef86718620a439663c7f commit fb860ed0c52c2c1e7792ef86718620a439663c7f Author: Ka Ho Ng AuthorDate: 2024-03-25 20:10:42 +0000 Commit: Ka Ho Ng CommitDate: 2024-03-25 20:11:42 +0000 libfetch: parse scheme://domain:/ correctly This improves URL-parsing compability with cURL, and unbreaks parsing of similar kinds of URLs after commit 8d9de5b10a24. Sponsored by: Juniper Networks, Inc. Reviewed by: des MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D44493 --- lib/libfetch/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c index 8fdcc8e8752e..df97bf486f9b 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -426,7 +426,7 @@ fetchParseURL(const char *URL) goto ouch; } } - if (n < 1 || n > IPPORT_MAX) + if (p != q && (n < 1 || n > IPPORT_MAX)) goto ouch; u->port = n; p = q;