Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

endless loop in jmespath::search #469

Closed
MonkeybreadSoftware opened this issue Nov 14, 2023 · 1 comment · Fixed by microsoft/vcpkg#36163
Closed

endless loop in jmespath::search #469

MonkeybreadSoftware opened this issue Nov 14, 2023 · 1 comment · Fixed by microsoft/vcpkg#36163

Comments

@MonkeybreadSoftware
Copy link
Contributor

if the expression for jmespath::search contains an extra CR on the end, we get an endless loop.

It looks like advance_past_space_character detects we are >= end and thus sets ec to an error.
But ec is not checked.

So after calling advance_past_space_character(ec);, we may need to add if (ec) {return jmespath_expression();} to exit the loop.

@danielaparker
Copy link
Owner

danielaparker commented Nov 15, 2023

Interesting edge case, I changed advance_past_space_character to allow it, since we already allow a CR followed by a space character (on master.)

git-hulk pushed a commit to apache/kvrocks that referenced this issue Nov 27, 2023
Bump jsoncons to 0.172.0. Full release notes - https://github.com/danielaparker/jsoncons/releases/tag/v0.172.0

Key features:

- Fixed issue danielaparker/jsoncons#469 affecting JSMESPath expressions with terminating CR
- Added result_option sort_descending
- Added new classes basic_json_location, basic_path_element, and basic_path_node
- Added a new functions get and remove for selecting a single JSON value from a JSON document at
a location represented by a json_location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants