Files
jq/tests
davidscottpope-gif a5dc7f5967 Reject invalid timestamp inputs before conversion to time_t (#3645)
gmtime/0 and localtime/0 converted the number of seconds to time_t
before checking it, which is undefined behavior for nan, infinite and
values like 1e20 that do not fit, so jq built with UBSan aborted.

Check the range first and raise the existing "error converting number
of seconds since epoch to datetime" error, which strftime/1 and
strflocaltime/1 also report for such numbers. The error can now be
caught: `try (1e20 | gmtime) catch .` returns the message instead of
aborting, and an input of exactly 2^63 is rejected too.
2026-12-04 08:54:27 +09:00
..
…
…
…
…
…
…
…