Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
topdown/json: Fix panic in json.filter on empty JSON paths. (open-pol…
…icy-agent#5200) This commit fixes a panic discovered in the `json.filter` builtin that could be triggered with an empty JSON path parameter, such as `""`. This panic was caused by indexing logic in a helper function always assuming it had at least one path segment to work with, and thus indexing out-of-bounds when no path segment was present. The issue was fixed by adding an extra check to the helper function for the null path case, and adding new unit tests to check for the issue. Fixes: open-policy-agent#5199 Signed-off-by: Philip Conrad <philipaconrad@gmail.com> Signed-off-by: Byron Lagrone <byron.lagrone@seqster.com>
- Loading branch information