From nobody Wed Feb 21 20:59:36 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 4Tg7tx0bB5z5BLjD; Wed, 21 Feb 2024 20:59:37 +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 4Tg7tx04crz4Hy6; Wed, 21 Feb 2024 20:59:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708549177; 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=qxVf6EW4m5rFDkHpXrCce9NmyrH41L06vRTfIQBjKFY=; b=t/B5fvwDUTTGWxBb+j07lbE9QtY/R1ApuxATn1FnrW5NcCc/FAZkbaQ6uh/3QETqLlQGOG D3mQzDJGJKmF3VGyAfNFy2L2/hucJGTiVAVp4WN7GoYLDJY1pKyF+/z6NG1YGR3p5nitEY QN4udDdzl/DBpR/t9xEL1oS/NwlLKYx1Dd7d4Rb5OZxBzyfSVvdqaRNRbiALrgifrpNLPz ENvh9h+mzalriWCon77SK7hWIvZUC6/t0f6Va/QWRMRgYoULx3oJ2Yf26GdQrDJqoMmLW+ 9c+Rid8zheOGw/NeKezwYxQ4JguP5lpFp+voVEVbkLt0sT4RbQUifhZQOwGSFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708549177; 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=qxVf6EW4m5rFDkHpXrCce9NmyrH41L06vRTfIQBjKFY=; b=LyGSodqI4hS6GfWNEPLccFK42rIliQDTBxzgS2/jyC1GaQTgmc2JP+9YnfZf0rz8kkENvJ e2mD3bdhxgLhBNp9msDMdgQ0a17WaFNV2oRj67FSZDy3QXqAHsBGQ9SlOwTtEOB2fjh5vS j+IMRNN4FlxftbsAzEoirUswid0c+d2dNdRbt0zY5XArBsp2sPIKkl/odwT/Fb0Tjj5zU0 8pueLhB8Ga0vzqOmyIhMrmV+D0oMMgDuEeE6JtDXnalS90OBov0odqoC+3jy8c2itBnzWC WutWAU9T9eV6GNmgAxgF+gqHXUsJSs9DKlT+RksWewurOL+WA3iJsQdyKQD/eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708549177; a=rsa-sha256; cv=none; b=Ci3f3x5pufcWejnOueRpuHf3xpcLAosECFZ2QAveiSSuwKfMjS9VtY+YPddvqqcTAa1NdK 1JdPsMNqanWT679p9AFHZl+TvhrxEeGV8q0kPQgEkH6nWCWsMxSA1+bz4vTcRyiAec42+I pAdWRZDADcpli6rcoOHsKLhdk3J4OjGZEzrNDn6L2NzbeR+rR6+hf119gtsR+AjhDf03hF oW/axdxbxamL+pxDuww955WkHiEs5BeZsyeru7ShPgib4anSDUTg0Y+ZaH4EXLTdh6Tqef 8lEXb8qRM9cNNWzIUWHAk89qQbbp5I5pHiKSPR0Kop7GvoxvYs7ynujoylJ7kQ== 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 4Tg7tw6F7wz1JCR; Wed, 21 Feb 2024 20:59:36 +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 41LKxawM037202; Wed, 21 Feb 2024 20:59:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41LKxaJo037199; Wed, 21 Feb 2024 20:59:36 GMT (envelope-from git) Date: Wed, 21 Feb 2024 20:59:36 GMT Message-Id: <202402212059.41LKxaJo037199@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: beb958dca02a - stable/13 - tzcode: Fix overflow handling in TZ parser. 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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: beb958dca02abf79a2172e702c2d24bbccde60fa Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=beb958dca02abf79a2172e702c2d24bbccde60fa commit beb958dca02abf79a2172e702c2d24bbccde60fa Author: Dag-Erling Smørgrav AuthorDate: 2024-02-18 09:48:08 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-02-21 20:59:26 +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) --- 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);