PaesslerAG / jsonpath

BSD 3-Clause "New" or "Revised" License
172 stars 37 forks source link

Negative array index causes panic #2

Closed maja42 closed 5 years ago

maja42 commented 6 years ago

When accessing an array like this:

arr[-1]

... I expect jsonpath to return an error. Instead it panics (range error). In evaluable.go (line 105), only the array length (upper limit) is checked, but not if the index is negative.

generikvault commented 5 years ago

I've added some testcases for this issue. It seems to bne already fixed. Sry for the slow response.