From bc9614682571fa2e8185398c89322c0300f92f76 Mon Sep 17 00:00:00 2001 From: Emanuele Torre Date: Tue, 19 Mar 2024 02:01:53 +0100 Subject: builtin.c: jv2tm: fix UB and accept array inputs with not all the values Now, time functions accept array inputs even if they don't have all the elements, 0 will be assumed if a value is not present. Also, jv2tm now properly clamps large number values to a signed 32-bit integer and rejects nan. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65885 --- tests/jq.test | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/jq.test b/tests/jq.test index 463161c7..584ab2b6 100644 --- a/tests/jq.test +++ b/tests/jq.test @@ -1568,6 +1568,10 @@ strftime("%A, %B %d, %Y") 1435677542.822351 "Tuesday, June 30, 2015" +strftime("%Y-%m-%dT%H:%M:%SZ") +[2024,2,15] +"2024-03-15T00:00:00Z" + gmtime 1425599507 [2015,2,5,23,51,47,4,63] -- cgit v1.2.3