diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2023-03-27 15:18:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-27 15:18:08 -0400 |
commit | 322cace686fbd079877fc73f9aa68063c5c47dfb (patch) | |
tree | 755e0505d30c2d0734e1e0d723a463955ebe69c4 /numpy/f2py/crackfortran.py | |
parent | e5d6c9be432363ddb150b03a336c97ea9d5b6920 (diff) | |
parent | 988283a7a18ad15f00db28902c643f653dfd7278 (diff) | |
download | numpy-322cace686fbd079877fc73f9aa68063c5c47dfb.tar.gz |
Merge pull request #23460 from molsonkiko/crackfortran_backtracking
MAINT: Fix ReDOS vulnerability in crackfortran.py
Diffstat (limited to 'numpy/f2py/crackfortran.py')
-rwxr-xr-x | numpy/f2py/crackfortran.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/f2py/crackfortran.py b/numpy/f2py/crackfortran.py index b831697d8..36a913047 100755 --- a/numpy/f2py/crackfortran.py +++ b/numpy/f2py/crackfortran.py @@ -935,7 +935,7 @@ typedefpattern = re.compile( r'(?:,(?P<attributes>[\w(),]+))?(::)?(?P<name>\b[a-z$_][\w$]*\b)' r'(?:\((?P<params>[\w,]*)\))?\Z', re.I) nameargspattern = re.compile( - r'\s*(?P<name>\b[\w$]+\b)\s*(@\(@\s*(?P<args>[\w\s,]*)\s*@\)@|)\s*((result(\s*@\(@\s*(?P<result>\b[\w$]+\b)\s*@\)@|))|(bind\s*@\(@\s*(?P<bind>.*)\s*@\)@))*\s*\Z', re.I) + r'\s*(?P<name>\b[\w$]+\b)\s*(@\(@\s*(?P<args>[\w\s,]*)\s*@\)@|)\s*((result(\s*@\(@\s*(?P<result>\b[\w$]+\b)\s*@\)@|))|(bind\s*@\(@\s*(?P<bind>(?:(?!@\)@).)*)\s*@\)@))*\s*\Z', re.I) operatorpattern = re.compile( r'\s*(?P<scheme>(operator|assignment))' r'@\(@\s*(?P<name>[^)]+)\s*@\)@\s*\Z', re.I) |