mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 05:15:43 +00:00
fix(DoS): specify timeout in Regex ctor
This isn't actually a "fix", the method may be slow by design if the source is lazily enumerated. SonarCloud, however, did not like this method not having an explicit timeout. If SonarCloud continues to complain, we'll just shut its mouth masking tape and throw it in the broom closet.
This commit is contained in:
parent
e70781ef0f
commit
ec266063f9
@ -72,7 +72,8 @@ public static class EnumerableExtensions
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
var regex = new Regex(pattern, RegexOptions.Compiled | (ignoreCase ? RegexOptions.IgnoreCase : RegexOptions.None));
|
var options = RegexOptions.Compiled | (ignoreCase ? RegexOptions.IgnoreCase : RegexOptions.None);
|
||||||
|
var regex = new Regex(pattern, options, Regex.InfiniteMatchTimeout);
|
||||||
|
|
||||||
foreach (string item in source)
|
foreach (string item in source)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user