Add missing validity check in f_strflocaltime after f_localtime (#3491)
This commit is contained in:
1 parent
c3d3e7d656
commit
262f0b81c1
1 file changed
+4
@@ -1803,6 +1803,10 @@ static jv f_strftime(jq_state *jq, jv a, jv b) {
|
|||||||
static jv f_strflocaltime(jq_state *jq, jv a, jv b) {
|
static jv f_strflocaltime(jq_state *jq, jv a, jv b) {
|
||||||
if (jv_get_kind(a) == JV_KIND_NUMBER) {
|
if (jv_get_kind(a) == JV_KIND_NUMBER) {
|
||||||
a = f_localtime(jq, a);
|
a = f_localtime(jq, a);
|
||||||
|
if (!jv_is_valid(a)) {
|
||||||
|
jv_free(b);
|
||||||
|
return a;
|
||||||
|
}
|
||||||
} else if (jv_get_kind(a) != JV_KIND_ARRAY) {
|
} else if (jv_get_kind(a) != JV_KIND_ARRAY) {
|
||||||
return ret_error2(a, b, jv_string("strflocaltime/1 requires parsed datetime inputs"));
|
return ret_error2(a, b, jv_string("strflocaltime/1 requires parsed datetime inputs"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user