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

Catastrophic backtracking on Java's properties Lexer #2356

Closed
SCH227 opened this issue Feb 26, 2023 · 0 comments · Fixed by #2404
Closed

Catastrophic backtracking on Java's properties Lexer #2356

SCH227 opened this issue Feb 26, 2023 · 0 comments · Fixed by #2404
Labels
A-lexing area: changes to individual lexers
Milestone

Comments

@SCH227
Copy link

SCH227 commented Feb 26, 2023

The following pattern is inefficient:
r'([ \f\t]*)([=:]*)([ \f\t]*)(.*(?<!\\)(?:\\{2})*)(\\)(?!\\)$
https://github.com/pygments/pygments/blob/master/pygments/lexers/configs.py#L141

jeanas added a commit to jeanas/pygments that referenced this issue Apr 5, 2023
Use special lexer rules for escapes; fixes catastrophic backtracking,
and highlights them too. (Also change Operator to Punctuation for the
key/value separator.)

Fixes pygments#2356
jeanas added a commit to jeanas/pygments that referenced this issue Apr 5, 2023
Use special lexer rules for escapes; fixes catastrophic backtracking,
and highlights them too. (Also change Operator to Punctuation for the
key/value separator.)

Fixes pygments#2356
jeanas added a commit to jeanas/pygments that referenced this issue Apr 17, 2023
Use special lexer rules for escapes; fixes catastrophic backtracking,
and highlights them too.

Fixes pygments#2356
jeanas added a commit that referenced this issue Apr 17, 2023
Use special lexer rules for escapes; fixes catastrophic backtracking,
and highlights them too.

Fixes #2356
@Anteru Anteru added this to the 2.15.1 milestone Apr 18, 2023
@Anteru Anteru added the A-lexing area: changes to individual lexers label Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lexing area: changes to individual lexers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants