Commit 891769a
committed
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.1 parent 45b5e1f commit 891769a
File tree
3 files changed
+67
-34
lines changed- polyfill/lib
- spec
3 files changed
+67
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
2422 | 2423 | | |
2423 | 2424 | | |
2424 | 2425 | | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
2425 | 2430 | | |
2426 | 2431 | | |
2427 | 2432 | | |
| |||
2479 | 2484 | | |
2480 | 2485 | | |
2481 | 2486 | | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
2482 | 2498 | | |
2483 | 2499 | | |
2484 | 2500 | | |
| |||
3260 | 3276 | | |
3261 | 3277 | | |
3262 | 3278 | | |
3263 | | - | |
3264 | | - | |
3265 | | - | |
3266 | | - | |
3267 | | - | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
3268 | 3285 | | |
3269 | 3286 | | |
3270 | 3287 | | |
3271 | 3288 | | |
3272 | | - | |
3273 | | - | |
3274 | | - | |
3275 | | - | |
3276 | | - | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
| 3294 | + | |
| 3295 | + | |
| 3296 | + | |
| 3297 | + | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
| 3304 | + | |
| 3305 | + | |
| 3306 | + | |
3277 | 3307 | | |
3278 | 3308 | | |
3279 | 3309 | | |
| |||
3282 | 3312 | | |
3283 | 3313 | | |
3284 | 3314 | | |
3285 | | - | |
3286 | | - | |
3287 | | - | |
3288 | | - | |
3289 | | - | |
3290 | | - | |
3291 | | - | |
3292 | | - | |
| 3315 | + | |
| 3316 | + | |
| 3317 | + | |
3293 | 3318 | | |
3294 | 3319 | | |
3295 | 3320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
937 | 937 | | |
938 | 938 | | |
939 | 939 | | |
| 940 | + | |
940 | 941 | | |
941 | 942 | | |
942 | 943 | | |
| |||
978 | 979 | | |
979 | 980 | | |
980 | 981 | | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
981 | 990 | | |
982 | 991 | | |
983 | 992 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1444 | 1444 | | |
1445 | 1445 | | |
1446 | 1446 | | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
1451 | 1451 | | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
1460 | | - | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
1464 | 1463 | | |
1465 | 1464 | | |
1466 | 1465 | | |
| |||
0 commit comments