You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OSS-FUZZ is unhappy with a filter that uses _nwise(0).
Note that _nwise(0) typically behaves like recurse([]), and one could argue that the def of _nwise/1
is just fine. If the current behavior is judged to be acceptable, what should be done about 68056?
To Reproduce
[1] | _nwise(0)
Expected behavior
If the current behavior is deemed unsatisfactory, how should the def be altered?
Plausible alternatives would include:
def _nwise($n):
def n: if length <= $n then . else .[0:$n] , (.[$n:] | n) end;
if $n <= 0 then empty
else n
end;
and similar alternatives, e.g. replacing empty above with a call to error.
(Since the guard is outside def n, the performance impact would be negligible.)
Additional context
Neither gojq nor jaq define _nwise/1.
The text was updated successfully, but these errors were encountered:
Describe the bug
OSS-FUZZ is unhappy with a filter that uses _nwise(0).
Note that
_nwise(0)
typically behaves likerecurse([])
, and one could argue that the def of _nwise/1is just fine. If the current behavior is judged to be acceptable, what should be done about 68056?
To Reproduce
Expected behavior
If the current behavior is deemed unsatisfactory, how should the def be altered?
Plausible alternatives would include:
and similar alternatives, e.g. replacing
empty
above with a call toerror
.(Since the guard is outside
def n
, the performance impact would be negligible.)Additional context
Neither gojq nor jaq define
_nwise/1
.The text was updated successfully, but these errors were encountered: