excludeChars are now escaped before using them as regExp

This commit is contained in:
Winni Neessen 2021-03-21 17:27:01 +01:00
parent d2eae0da9f
commit 1f3aeb9d44
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -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, "")
}