mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-09 04:36:31 +00:00
tzcode: Fix overflow handling in TZ parser.
Obtained from: upstream 9fc11a27 MFC after: 1 week PR: 276281
This commit is contained in:
parent
078a31136c
commit
1365bb722a
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user