-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normative: Prevent arbitrary loops in NormalizedTimeDurationToDays
It's possible to make at least the second loop continue arbitrarily long until going out of range, using a contrived custom time zone. This unrolls the loops and executes them no more than twice. In order to weed out this situation earlier, when possible, also put a limit on the maximum possible UTC offset shift: - For backwards UTC offset shifts, if getPossibleInstantsFor returns more than one instant, the difference between the earliest and latest instants in the returned array may not be more than 24 hours. - For forwards UTC offset shifts, if getPossibleInstantsFor returns zero instants, the difference between the offsets 24 hours before and after returned by getOffsetNanosecondsFor may not be more than 24 hours.
- Loading branch information
Showing
3 changed files
with
67 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters