From nobody Sun Feb 20 14:32:16 2022 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 A0A3519D006F; Sun, 20 Feb 2022 14:32:16 +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 4K1nvN458Gz3LGq; Sun, 20 Feb 2022 14:32:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645367536; 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=inDHx7EVw+Knu5IRHRsBfX6dLlPxWvWSR3do/zcYhTo=; b=iNbuaGGVyopM2EvXghMn4gcJBXnGdYAlN6r9iFyGte/eUB+d4nyJlQf30HDeDJKjQaxQzQ 7wKm2TC8OFXPz0DkgT5GQ1ia3TGz8no3r/VYBwGUr3Xhq/zNDgPABzdJLewGaHjFYfy0go faxjk4goawEGjqky69pBGxOUYtJffCzdGZwO3FpoIWiudd1r6GIGE/wnnAFgqPRHPHTjMx boS2vCQAp80VEE1fV6O5Z+TBjxAyGlFfLhfKPWv/HAbUew/TxLbmyN3sujo/XNIPSQGDX5 32oN10eKah1Urbwt6TWbga21H83XIbCr5vDTmQ6MrC8SP7jOc4Jq+d+RLb3ugw== 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 6C2B11E172; Sun, 20 Feb 2022 14:32:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21KEWGFk021005; Sun, 20 Feb 2022 14:32:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21KEWGeA021004; Sun, 20 Feb 2022 14:32:16 GMT (envelope-from git) Date: Sun, 20 Feb 2022 14:32:16 GMT Message-Id: <202202201432.21KEWGeA021004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: 32066c96fa00 - main - fetch: make -S argument accept values > 2GB 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: se X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 32066c96fa00fc19c8355e1956ca5aa9ead37673 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645367536; 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=inDHx7EVw+Knu5IRHRsBfX6dLlPxWvWSR3do/zcYhTo=; b=SaMpDLvAFpflchtZVtqxLOFiP39FsxWmJeSvG/lJILBKxdMhPHVCp3O+c232PE/7wOSq1L 7WSZNlGc6zZSEHg1xzae1f/ELzodvww69J94uA9Y8QIMiBJgB8Dv2Ft4cKGqoRvKQaClhP Njr5nIhLjrGJbP3e78SIBe6kqXQX8QV6hCmIVO9O9WJGMMIgKeAbnMmpyLX24SAyBu1s9G RWeGtTvEU7KqW5ouBFD+TibqVxbzAqJ85fsthie+2FdcwS7Am3UZ1i18E2xPn32x66J7QK D5l3bNvQ8OteG2RjNw/zP811o2j89ysZ33BoApN00PhaB0GK89sbR/J7pZUVYQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645367536; a=rsa-sha256; cv=none; b=HbY0LpKNEyyEWsk/az1lpTYeW+rbXH3z+Q4YlWfn97iKBfpsJIlkYTay8JlDHwpLsnUvOR +i+8kvPxaZNsWUg/bpbZ38QKjU5wH3u9PaQs8fc5uFbT52fW7jt1MdlUDR+tDnzkYIyUXm o1uJssXOsUBMjs7osKFXANiqCh11byo0wCBTJKwljGSHSS+xSveT/J3zON7I3voAKMuhbj K3e96zRO5AamI1kvybp3P+pNn7QVI8B0Z0wVNK0h2zjEHI9lEUCLBFRGdThz8nOy9INmbz 7li20yj48YrlU+z4/le6Qaq4Vd9JJyTb31drLP5kF+JXkzg21v7oy6oP+/C7VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/src/commit/?id=32066c96fa00fc19c8355e1956ca5aa9ead37673 commit 32066c96fa00fc19c8355e1956ca5aa9ead37673 Author: Stefan Eßer AuthorDate: 2022-02-20 14:24:43 +0000 Commit: Stefan Eßer CommitDate: 2022-02-20 14:24:43 +0000 fetch: make -S argument accept values > 2GB Use strtoll() to parse the argument of the -S option. FreeBSD has supported 64 bit file offsets for more than 25 years on all architectures and off_t is a 64 bit integer type for that reason. While strtol() returns a 64 bit value on 64 LP64 architectures, it is limit to 32 bit on e.g. i386. The strtoll() function returns a 64 but result on all supported architectures and therefore supports the possible file lengths and file offsets on 32 bit archtectures. Reported by: antoine MFC after: 3 days --- usr.bin/fetch/fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index 73ee96541859..ad51de15f4d3 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -1005,7 +1005,7 @@ main(int argc, char *argv[]) r_flag = 1; break; case 'S': - S_size = (off_t)strtol(optarg, &end, 10); + S_size = strtoll(optarg, &end, 10); if (*optarg == '\0' || *end != '\0') errx(1, "invalid size (%s)", optarg); break;