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

Regex in CssParser never ends and uses 100% cpu. #233

Open
mikemakos opened this issue Oct 9, 2020 · 1 comment
Open

Regex in CssParser never ends and uses 100% cpu. #233

mikemakos opened this issue Oct 9, 2020 · 1 comment
Labels
performance ⚡️ Issues related to performance and benchmarks

Comments

@mikemakos
Copy link

Using the css style from this url:
https://assets1-production.mightynetworks.com/assets/mb_mailer_main-6b7073985319ef7f1b2ff77ccc50d90e87e094b4d59d59e9bd335987c5edcad3.css

makes the method CleanUp inside CssParser to never finish and uses 100% of the CPU.
The problem is in CssCommentRegex.Replace in line 113.
I am not good with Regex, so either look at why the Regex stucks in an endless back tracking loop or
add a Regex.MatchTimeout property to end the processing.

Thanks

@reinaldocoelho
Copy link
Contributor

Maybe it could be related with #290

@martinnormark martinnormark added the performance ⚡️ Issues related to performance and benchmarks label Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance ⚡️ Issues related to performance and benchmarks
Projects
None yet
Development

No branches or pull requests

3 participants