From nobody Wed Apr 03 19:12:44 2024 X-Original-To: dev-commits-src-all@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 4V8vXD1qzRz5Ff53; Wed, 3 Apr 2024 19:12:44 +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 4V8vXD1Fzhz4J1P; Wed, 3 Apr 2024 19:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712171564; 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=rDf9gUHjNxyQdUcI/NCe1SVVtGGAA4cQIDdClvSOfM0=; b=wtZ1wJdr/Hkx/EVvQ1yfuPwiMtApbfl85Vtfv0N0/PqrnDAAvnEMwkQlNCqiFsi682lyg5 mY3qay7em7tF0enHukq3FRgkXF9EMMO8YqLtN2yLFldu9QmO6BpjiYMIfuQpUnZ8DOW/Dc nBBVSqEDkx7gZZPR9vGBuJxVZG42CesKiFIqfFf1vfVFnfugGx33DlSOi6IuURumiyi8/Y 9emKKaJgl+7sYZAOpEGrJZHm6ixuWFTTt4ffjOASm1qTDwhpuf9A0DOnDXQNFhUGt3nowE K1cwiROvhf1T0PTHQsuefYtJD5CYjmnecC/baXnKrDHO9qjKBSzYM61SCBPbdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712171564; a=rsa-sha256; cv=none; b=paqed/uq9Erb/qezONza+SSNwid+JDse9xdpAYTMC1gLMJSxr4FJafVIzuh9bEv5RzTRBk sg5nHRqUg9+uPuTnPLCUJYbH7DyI417xqa1lDjdQBIrUIL3MIe7YEBJqIELBMNVxm9aLat t6Sz2cE9H2z1/NOagtIUWrsGX2HJVzRtE6p8vae8rHLo+NFlDilrviD/NevZ2HY+w2RqkI v1D3YcJqzNRMXgK5M58pqVCSo4SDZtB32JNxzyACOXo9+Mf2nNyYENriz3uzFe6BzS96Iu 9Dt4GPHBaUlNWZx+8eoPP3qd8aP+rggkO/yVh2oWf3QzaUDl40sSvliFhW+Pfw== 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=1712171564; 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=rDf9gUHjNxyQdUcI/NCe1SVVtGGAA4cQIDdClvSOfM0=; b=sbJgyQ/QuA7eLzrV9O2Ims+0J7TvMe93rJ+WWrh45bUdxSyfce9U2V6yC2kw0sMezIPTis 7vqEN1DZEw+zIcLxz0TfZIGsPvlOE6eyDo2txwFnprzkRtYfKxFMwP2xBp2UnGq2uXpI4Q wEptRWB6f+CJEqdOaVTBHcLC1IriGasHneGAifKeYVi0M+L8XxFDU16guGXOd8mHKqCIcy Lv1RNgwwYdaaZvLgVrF3IOZOlPxUXzXzdj/MbHwm60n2xa66qWkN8BWGU+h0iIHyZesyqh DXorUjpzgeYhZS6tcpMWRXuHiwiJVkKD6J1F4YICunyjjMLn/GfhJbc/VcUI5Q== 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 4V8vXD0sb1zlWm; Wed, 3 Apr 2024 19:12:44 +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 433JCiPw001924; Wed, 3 Apr 2024 19:12:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 433JCiJh001921; Wed, 3 Apr 2024 19:12:44 GMT (envelope-from git) Date: Wed, 3 Apr 2024 19:12:44 GMT Message-Id: <202404031912.433JCiJh001921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ka Ho Ng Subject: git: c89889b9c342 - stable/13 - libfetch: parse scheme://domain:/ correctly List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: c89889b9c342e764e39b351d5024a4ba3429fb15 Auto-Submitted: auto-generated The branch stable/13 has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=c89889b9c342e764e39b351d5024a4ba3429fb15 commit c89889b9c342e764e39b351d5024a4ba3429fb15 Author: Ka Ho Ng AuthorDate: 2024-03-25 20:10:42 +0000 Commit: Ka Ho Ng CommitDate: 2024-04-03 19:12:38 +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 (cherry picked from commit fb860ed0c52c2c1e7792ef86718620a439663c7f) --- 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 135ee8dad151..8cb3536a46c5 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -427,7 +427,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;