Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: Limit Duration units to prevent arbitrary-precision integer arithmetic, and prevent loops #2612

Merged
merged 2 commits into from
Feb 2, 2024

Commits on Feb 2, 2024

  1. 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.
    ptomato committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    d78011a View commit details
    Browse the repository at this point in the history
  2. Update test262

    ptomato committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    a57b62a View commit details
    Browse the repository at this point in the history