Skip to content

Commit 43a9c9b

Browse files
committed
Limit the amount of whitespace to search/backtrack. Fixes #3659.
1 parent 5791343 commit 43a9c9b

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

setuptools/package_index.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def wrapper(*args, **kwargs):
217217
return wrapper
218218

219219

220-
REL = re.compile(r"""<([^>]*\srel\s*=\s*['"]?([^'">]+)[^>]*)>""", re.I)
220+
REL = re.compile(r"""<([^>]*\srel\s{0,10}=\s{0,10}['"]?([^'" >]+)[^>]*)>""", re.I)
221221
"""
222222
Regex for an HTML tag with 'rel="val"' attributes.
223223
"""

setuptools/tests/test_packageindex.py

-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ def test_percent_in_password(self, temp_home):
307307
assert cred.password == 'pity%'
308308

309309

310-
@pytest.mark.xfail(reason="#3659")
311310
@pytest.mark.timeout(1)
312311
def test_REL_DoS():
313312
"""

0 commit comments

Comments
 (0)