mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.9] bpo-46474: Avoid REDoS in EntryPoint.pattern (sync with importlib_metadata 4.10.1) (GH-30803). (GH-30828)
(cherry picked from commit 51c3e28c8a
)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
This commit is contained in:
parent
d0852c447a
commit
1514d1252f
2 changed files with 4 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
In ``importlib.metadata.EntryPoint.pattern``, avoid potential REDoS by
|
||||
limiting ambiguity in consecutive whitespace.
|
Loading…
Add table
Add a link
Reference in a new issue