From 23b3972503d5ee4ff315c031691796fb68166d4c Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 10 Jun 2019 20:47:30 -0400 Subject: [PATCH] catch bad regex parse --- src/Core/Services/CipherService.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Core/Services/CipherService.cs b/src/Core/Services/CipherService.cs index 77f1533e7..a1a6f6c8b 100644 --- a/src/Core/Services/CipherService.cs +++ b/src/Core/Services/CipherService.cs @@ -383,12 +383,16 @@ namespace Bit.Core.Services } break; case UriMatchType.RegularExpression: - var regex = new Regex(u.Uri, RegexOptions.IgnoreCase, TimeSpan.FromSeconds(1)); - match = regex.IsMatch(url); - if(match) + try { - AddMatchingLogin(cipher, matchingLogins, matchingFuzzyLogins); + var regex = new Regex(u.Uri, RegexOptions.IgnoreCase, TimeSpan.FromSeconds(1)); + match = regex.IsMatch(url); + if(match) + { + AddMatchingLogin(cipher, matchingLogins, matchingFuzzyLogins); + } } + catch(ArgumentException) { } break; case UriMatchType.Never: default: