mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-22 02:37:15 +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 {
|
do {
|
||||||
int_fast32_t yearsecs
|
int_fast32_t yearsecs
|
||||||
= year_lengths[isleap(yearbeg - 1)] * SECSPERDAY;
|
= year_lengths[isleap(yearbeg - 1)] * SECSPERDAY;
|
||||||
|
time_t janfirst1 = janfirst;
|
||||||
yearbeg--;
|
yearbeg--;
|
||||||
if (increment_overflow_time(&janfirst, -yearsecs)) {
|
if (increment_overflow_time(&janfirst1, -yearsecs)) {
|
||||||
janoffset = -yearsecs;
|
janoffset = -yearsecs;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
janfirst = janfirst1;
|
||||||
} while (atlo < janfirst
|
} while (atlo < janfirst
|
||||||
&& EPOCH_YEAR - YEARSPERREPEAT / 2 < yearbeg);
|
&& EPOCH_YEAR - YEARSPERREPEAT / 2 < yearbeg);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue