From nobody Fri Feb 23 11:41:32 2024 X-Original-To: dev-commits-src-branches@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 4Th7Q442Mlz5CJjK; Fri, 23 Feb 2024 11:41:32 +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 4Th7Q43cVDz4jyh; Fri, 23 Feb 2024 11:41:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708688492; 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=HZg0+H/usjasNl0wv0D4Rpaya5xMFQIN3Ga/FG0XPzM=; b=oJyOYAZonbzry/Cyoptpiho+3/A8NhBIlUbmHdXwRQYojszFwCqn9WYA0D3V7KfpttLsaC itatBjDmOCr9FHfwkGvKuz4+Mpnn0o2BICw0Snc0Eikxs1xj/EslpjgctGR4Pl4jj2oDIj c0MkmLyOfGFyEry3znt6sDCZYUSKh4VVcR4qiKcaHx0Fmz9EsrsKZdxACflWVMmNn/Zy+n M1ZQn9VorkLD0gu9Y8iyC+li32jXqG8I2L7J4mW5+o+jqaVZ2ROFLOYHiZwDp/T5V2RRoK dudTTg5o55hsEzTyMHrDud9ae743CSS1hfRlbswc5jODkxSIood/lhriiZOTXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708688492; a=rsa-sha256; cv=none; b=FWfGtAit78bDFayJsOLwsakWRG/eiVGQknON3KHPizxxSFTDFPB6SkWMtPximTHVnHna28 zuowsCMnXfgnzGj8WbHKTjxRgs4vZXK66XUHNctAiCLsJQVvhOqpwcTHJbtZTisBRIGUH0 HU/WPVIzWfwZJKlM1AZnzM3jhlMyHSwBzt0ANgJ3hC3EjeWu8uGLufAGT2bbuOvk2FR1s7 k0gBcKTS2QuzSERfxFr0ViluMh72KcVs//VjEfkOoMGqGD9qKyD+l5em+Q0+rS80TlFLlY 9TCdDl2FwDyN5wdAYetk4v1yAOShk7aXX0wPtZirQB3WUD9flmgDnS0ImMQGkA== 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=1708688492; 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=HZg0+H/usjasNl0wv0D4Rpaya5xMFQIN3Ga/FG0XPzM=; b=iG4tiEKhvGKga30oxNfSHCXMctmTYwl/oecFDfHJTyYToNKYwkcZ/ihpYJcSrMvC9aWPuS OzqmVsR5l6VALelPr1uynQ28nIBLCYostK452NlqkIRt6m3kSyKAWkH6plbZ+XdpaShl5v 0kqKAdYDopF9mBTZTpwmGZjY/yUEscjLo8qgGVRAoI6vgr69eb1Y88xRO5qdDhYdVPcfGg KKqkLjhLuMcBzB1rsy4SQBILRVBqqk/dfiSx3hgNxhjH9F1DTe2o8nfa7t1m+iWJ2WXU3h s12ZxN/gRjZgNVL6XcA/RT5YUHLo17sZWoWm7YhaarqkF1jxs52ZmO5dSNCEGg== 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 4Th7Q42g3TzF9k; Fri, 23 Feb 2024 11:41:32 +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 41NBfWrM078563; Fri, 23 Feb 2024 11:41:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41NBfW7Y078561; Fri, 23 Feb 2024 11:41:32 GMT (envelope-from git) Date: Fri, 23 Feb 2024 11:41:32 GMT Message-Id: <202402231141.41NBfW7Y078561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e99479f817c4 - releng/13.3 - tzcode: Fix overflow handling in TZ parser. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.3 X-Git-Reftype: branch X-Git-Commit: e99479f817c4714d396de1d403daa6f9bc3a32bb Auto-Submitted: auto-generated The branch releng/13.3 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e99479f817c4714d396de1d403daa6f9bc3a32bb commit e99479f817c4714d396de1d403daa6f9bc3a32bb Author: Dag-Erling Smørgrav AuthorDate: 2024-02-18 09:48:08 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-23 11:41:25 +0000 tzcode: Fix overflow handling in TZ parser. Obtained from: upstream 9fc11a27 MFC after: 1 week PR: 276281 Approved by: re (cperciva) (cherry picked from commit 1365bb722af1365baee6ea1e3d44917533908d53) (cherry picked from commit beb958dca02abf79a2172e702c2d24bbccde60fa) --- contrib/tzcode/localtime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/tzcode/localtime.c b/contrib/tzcode/localtime.c index 3bf9378fe673..8bf4fcb17d2d 100644 --- a/contrib/tzcode/localtime.c +++ b/contrib/tzcode/localtime.c @@ -1277,11 +1277,13 @@ tzparse(const char *name, struct state *sp, struct state *basep) do { int_fast32_t yearsecs = year_lengths[isleap(yearbeg - 1)] * SECSPERDAY; + time_t janfirst1 = janfirst; yearbeg--; - if (increment_overflow_time(&janfirst, -yearsecs)) { + if (increment_overflow_time(&janfirst1, -yearsecs)) { janoffset = -yearsecs; break; } + janfirst = janfirst1; } while (atlo < janfirst && EPOCH_YEAR - YEARSPERREPEAT / 2 < yearbeg);