summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-02-14 17:56:03 (GMT)
committerGitHub <noreply@github.com>2022-02-14 17:56:03 (GMT)
commit8a84aef0123bd8c13cf81fbc3b5f6d45f96c2656 (patch)
tree5fb12586739ac82049cbdee0894cb18b3a617e82 /Lib/importlib
parentf87e616af038ee8963185e11b96841c81e8ef15a (diff)
downloadcpython-8a84aef0123bd8c13cf81fbc3b5f6d45f96c2656.zip
cpython-8a84aef0123bd8c13cf81fbc3b5f6d45f96c2656.tar.gz
cpython-8a84aef0123bd8c13cf81fbc3b5f6d45f96c2656.tar.bz2
[3.8] bpo-46474: Avoid REDoS in EntryPoint.pattern (sync with importlib_metadata 4.10.1) (GH-30803). (#30829)
(cherry picked from commit 51c3e28c8a163e58dc753765e3cc51d5a717e70d) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/metadata.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/importlib/metadata.py b/Lib/importlib/metadata.py
index 9d2285c..c8d533c 100644
--- a/Lib/importlib/metadata.py
+++ b/Lib/importlib/metadata.py
@@ -49,8 +49,8 @@ class EntryPoint(
pattern = re.compile(
r'(?P<module>[\w.]+)\s*'
- r'(:\s*(?P<attr>[\w.]+))?\s*'
- r'(?P<extras>\[.*\])?\s*$'
+ r'(:\s*(?P<attr>[\w.]+)\s*)?'
+ r'((?P<extras>\[.*\])\s*)?$'
)
"""
A regular expression describing the syntax for an entry point,