diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2022-01-22 14:48:01 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2022-01-22 14:52:53 -0500 |
commit | 567eb96cdee585e5afc08595f73247a95b255d90 (patch) | |
tree | a1a78ded6f26b556fbe1c3a78c45c22e0ba6ecac /Lib | |
parent | 8f720d014037afd54cd514ab4b7db3b0f9704954 (diff) | |
download | cpython-git-bpo-46474/entrypoint-regex-fix.tar.gz |
bpo-46474: Fix for REDoS in EntryPoint.pattern (importlib_metadata 4.10.1).bpo-46474/entrypoint-regex-fix
Diffstat (limited to 'Lib')
-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 5ef6d9dc48..371c482209 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, |