diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2022-01-23 04:00:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-23 04:00:23 (GMT) |
commit | 51c3e28c8a163e58dc753765e3cc51d5a717e70d (patch) | |
tree | 3d207f1694b3e4f43d63f74842468b0b79ee05c3 /Lib/importlib | |
parent | b0898f4aa90d9397e23aef98a2d6b82445ee7455 (diff) | |
download | cpython-51c3e28c8a163e58dc753765e3cc51d5a717e70d.zip cpython-51c3e28c8a163e58dc753765e3cc51d5a717e70d.tar.gz cpython-51c3e28c8a163e58dc753765e3cc51d5a717e70d.tar.bz2 |
bpo-46474: Avoid REDoS in EntryPoint.pattern (sync with importlib_metadata 4.10.1) (GH-30803)
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/metadata/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/importlib/metadata/__init__.py b/Lib/importlib/metadata/__init__.py index 5ef6d9d..371c482 100644 --- a/Lib/importlib/metadata/__init__.py +++ b/Lib/importlib/metadata/__init__.py @@ -156,8 +156,8 @@ class EntryPoint(DeprecatedTuple): 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, |