Fix possible crash of profile name checker

This commit is contained in:
Erwan MATHIEU 2024-06-17 14:31:50 +02:00
parent 639fcca86a
commit 0f805983a2

View File

@ -37,6 +37,6 @@ class Profile(Linter):
config = ConfigParser() config = ConfigParser()
config.read([self._file]) config.read([self._file])
name_of_profile = config.get("general", "name") name_of_profile = config.get("general", "name")
redefined = re.compile(name_of_profile) redefined = re.compile(re.escape(name_of_profile))
found = redefined.search(self._content) found = redefined.search(self._content)
return name_of_profile, found return name_of_profile, found