Skip to content

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

Description

@mikemakos

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    performance ⚡️Issues related to performance and benchmarks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions