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 inefficient regular expressions in external/cmapscompress/parse.js #13836

Merged
merged 1 commit into from
Aug 1, 2021

Conversation

timvandermeij
Copy link
Contributor

The only purpose, according to the README and existing files, is to parse an integer from those lines, so (\d+) is sufficient for that. This avoids potential exponential backtracking as flagged by CodeQL. I have compared the output of the script with and without these changes and the resulting files are the same.

The only purpose, according to the README and existing files, is to
parse an integer from those lines, so (\d+) is sufficient for that. This
avoids potential exponential backtracking as flagged by CodeQL. I have
compared the output of the script with and without these changes and the
resulting files are the same.
Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@Snuffleupagus Snuffleupagus merged commit 1ea8cfa into mozilla:master Aug 1, 2021
@timvandermeij timvandermeij deleted the cmaps branch August 1, 2021 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants