From 1f3aeb9d44271e47e1e21a57d07dc6ee80652687 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Sun, 21 Mar 2021 17:27:01 +0100 Subject: [PATCH] excludeChars are now escaped before using them as regExp --- chars.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chars.go b/chars.go index 717d29e..2302745 100644 --- a/chars.go +++ b/chars.go @@ -29,7 +29,7 @@ func getCharRange() string { charRange = charRange + pwSpecialChars } if config.excludeChars != "" { - regExp := regexp.MustCompile("[" + config.excludeChars + "]") + regExp := regexp.MustCompile("[" + regexp.QuoteMeta(config.excludeChars) + "]") charRange = regExp.ReplaceAllLiteralString(charRange, "") }