catch bad regex parse

This commit is contained in:
Kyle Spearrin 2019-06-10 20:47:30 -04:00
parent 01a64676b4
commit 23b3972503

View file

@ -383,12 +383,16 @@ namespace Bit.Core.Services
} }
break; break;
case UriMatchType.RegularExpression: case UriMatchType.RegularExpression:
try
{
var regex = new Regex(u.Uri, RegexOptions.IgnoreCase, TimeSpan.FromSeconds(1)); var regex = new Regex(u.Uri, RegexOptions.IgnoreCase, TimeSpan.FromSeconds(1));
match = regex.IsMatch(url); match = regex.IsMatch(url);
if(match) if(match)
{ {
AddMatchingLogin(cipher, matchingLogins, matchingFuzzyLogins); AddMatchingLogin(cipher, matchingLogins, matchingFuzzyLogins);
} }
}
catch(ArgumentException) { }
break; break;
case UriMatchType.Never: case UriMatchType.Never:
default: default: