diff options
author | yeting li <liyt@ios.ac.cn> | 2020-09-06 12:12:28 +0800 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2020-09-10 23:33:01 +0200 |
commit | 5405dd5115d598fa69e49538d50ec79202b1b52e (patch) | |
tree | 6cba294452b2a088a7cfdcd2ca06d70cb77ca4fe /pylint/pyreverse/utils.py | |
parent | 74d5bcb352141bc742488e74d1b37c1cb381a7ce (diff) | |
download | pylint-git-5405dd5115d598fa69e49538d50ec79202b1b52e.tar.gz |
Bug: fix vulnerable regexes to avoid potential ReDoS.
Fix issue #3811
Diffstat (limited to 'pylint/pyreverse/utils.py')
-rw-r--r-- | pylint/pyreverse/utils.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pylint/pyreverse/utils.py b/pylint/pyreverse/utils.py index d8ac4f85f..ea853b857 100644 --- a/pylint/pyreverse/utils.py +++ b/pylint/pyreverse/utils.py @@ -49,9 +49,8 @@ def insert_default_options(): # astroid utilities ########################################################### - -SPECIAL = re.compile(r"^__[^\W_]+\w*__$") -PRIVATE = re.compile(r"^__\w*[^\W_]+_?$") +SPECIAL = re.compile(r"^__([^\W_]_*)+__$") +PRIVATE = re.compile(r"^__(_*[^\W_])+_?$") PROTECTED = re.compile(r"^_\w*$") |