davesnx / query-json

Faster, simpler and more portable implementation of `jq` in Reason
https://query-json.netlify.app
BSD 3-Clause "New" or "Revised" License
591 stars 6 forks source link

query-json --kind=inline '.[10]' '[1, 2, 3, 4, 5]' #26

Closed davesnx closed 4 years ago

davesnx commented 4 years ago
query-json: internal error, uncaught exception:
            Yojson.Basic.Util.Undefined("Index 10 out of bounds", _)

Index allows to access to array positions that are bigger than the length of the array, causing stack overflows (lol, this is def not C).

We could try/catch or I prefer if we can ensure that the operation Index is valid before running it and if that's the case show an error.

davesnx commented 4 years ago

Fixed on https://github.com/davesnx/query-json/commit/04c6958e320ba7a18da190bbc6a456dd149ad76b