Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Feb 2024 09:56:03 GMT
From:      Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 1365bb722af1 - main - tzcode: Fix overflow handling in TZ parser.
Message-ID:  <202402180956.41I9u3gM067248@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=1365bb722af1365baee6ea1e3d44917533908d53

commit 1365bb722af1365baee6ea1e3d44917533908d53
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2024-02-18 09:48:08 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2024-02-18 09:51:49 +0000

    tzcode: Fix overflow handling in TZ parser.
    
    Obtained from:  upstream 9fc11a27
    MFC after:      1 week
    PR:             276281
---
 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 2b33cce1ec50..25a65385256b 100644
--- a/contrib/tzcode/localtime.c
+++ b/contrib/tzcode/localtime.c
@@ -1246,11 +1246,13 @@ tzparse(const char *name, struct state *sp, struct state const *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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202402180956.41I9u3gM067248>