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

Fix pattern for values incorporating backslashes in JSON lexer #1331

Merged
merged 1 commit into from
Sep 17, 2019

Conversation

pyrmont
Copy link
Contributor

@pyrmont pyrmont commented Sep 16, 2019

It is possible for a JSON value that incorporates backslashes and colons to incorrectly match a pattern in the :name state. In certain situations, this can cause the lexing of a JSON file to hang indefinitely.

This commit adds \\ to the excluded character class in the :name state. This causes such strings to instead be matched in the :value state.

This fixes #1330.

@pyrmont pyrmont self-assigned this Sep 16, 2019
@pyrmont pyrmont added the needs-review The PR needs to be reviewed label Sep 16, 2019
@pyrmont pyrmont merged commit 7135f0b into rouge-ruby:master Sep 17, 2019
@pyrmont pyrmont removed the needs-review The PR needs to be reviewed label Sep 17, 2019
@pyrmont pyrmont deleted the bugfix.json-backtrace branch January 8, 2020 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON lexer spins in infinite loop
1 participant