mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-7816 time zone infinite loop breaking
X-SVN-Rev: 28298
This commit is contained in:
parent
45aa2210aa
commit
037e5ac508
1 changed files with 16 additions and 1 deletions
|
@ -360,7 +360,14 @@ BasicTimeZone::getTimeZoneRulesAfter(UDate start, InitialTimeZoneRule*& initial,
|
|||
if (!avail) {
|
||||
break;
|
||||
}
|
||||
time = tzt.getTime();
|
||||
UDate updatedTime = tzt.getTime();
|
||||
if (updatedTime == time) {
|
||||
// Time zones that have been manually initialized with inconsistent transtion rules
|
||||
// can bring us here. Bail out to prevent an infinite loop.
|
||||
status = U_INVALID_STATE_ERROR;
|
||||
goto error;
|
||||
}
|
||||
time = updatedTime;
|
||||
|
||||
const TimeZoneRule *toRule = tzt.getTo();
|
||||
for (i = 0; i < ruleCount; i++) {
|
||||
|
@ -511,6 +518,14 @@ error:
|
|||
delete orgRules;
|
||||
}
|
||||
if (done != NULL) {
|
||||
if (filteredRules != NULL) {
|
||||
while (!filteredRules->isEmpty()) {
|
||||
r = (TimeZoneRule*)filteredRules->orphanElementAt(0);
|
||||
delete r;
|
||||
}
|
||||
delete filteredRules;
|
||||
}
|
||||
delete res_initial;
|
||||
uprv_free(done);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue