PreMailer.Net icon indicating copy to clipboard operation
PreMailer.Net copied to clipboard

Regex in CssParser never ends and uses 100% cpu.

Open mikemakos opened this issue 5 years ago • 2 comments

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

mikemakos avatar Oct 09 '20 08:10 mikemakos

Maybe it could be related with #290

reinaldocoelho avatar Apr 20 '22 16:04 reinaldocoelho