Skip to content

bpo-29505: Fuzz struct.unpack and catch RecursionError in re.compile - #18679

Merged
gpshead merged 1 commit into
python:masterfrom
ammaraskar:fuzz_struct_unpack
Feb 28, 2020
Merged

bpo-29505: Fuzz struct.unpack and catch RecursionError in re.compile#18679
gpshead merged 1 commit into
python:masterfrom
ammaraskar:fuzz_struct_unpack

Conversation

@ammaraskar

@ammaraskarammaraskar commented Feb 27, 2020

Copy link
Copy Markdown
Member

The re.compile fix is needed for cases like:

Click to expand!
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((('((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((('(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((('((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((('((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((('(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((('((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((('((

which will cause a RecursionError like this:

...
File "C:\Users\ammar\workspace\cpython\lib\sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "C:\Users\ammar\workspace\cpython\lib\sre_parse.py", line 834, in _parse
p = _parse_sub(source, state, sub_verbose, nested + 1)
File "C:\Users\ammar\workspace\cpython\lib\sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "C:\Users\ammar\workspace\cpython\lib\sre_parse.py", line 834, in _parse
p = _parse_sub(source, state, sub_verbose, nested + 1)
File "C:\Users\ammar\workspace\cpython\lib\sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "C:\Users\ammar\workspace\cpython\lib\sre_parse.py"
...

https://bugs.python.org/issue29505

@codecov

codecovBot commented Feb 27, 2020

Copy link
Copy Markdown

Codecov Report

Merging #18679 into master will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@ Coverage Diff @@## master #18679 +/- ##
==========================================
- Coverage 82.12% 82.12% -0.01% 
==========================================
Files 1956 1955 -1 Lines 589830 584522 -5308 Branches 44477 44477 ==========================================
- Hits 484427 480064 -4363 + Misses 95752 94812 -940 + Partials 9651 9646 -5 
Impacted FilesCoverage Δ
Lib/distutils/tests/test_bdist_rpm.py30.00% <0.00%> (-65.00%)⬇️
Lib/distutils/command/bdist_rpm.py7.63% <0.00%> (-56.88%)⬇️
Modules/_decimal/libmpdec/umodarith.h80.76% <0.00%> (-19.24%)⬇️
Lib/test/test_urllib2net.py76.92% <0.00%> (-13.85%)⬇️
Lib/test/test_smtpnet.py78.57% <0.00%> (-7.15%)⬇️
Lib/ftplib.py63.85% <0.00%> (-6.06%)⬇️
Lib/test/test_ftplib.py87.11% <0.00%> (-4.72%)⬇️
Tools/scripts/db2pickle.py17.82% <0.00%> (-3.97%)⬇️
Tools/scripts/pickle2db.py16.98% <0.00%> (-3.78%)⬇️
Lib/test/test_socket.py71.94% <0.00%> (-3.77%)⬇️
... and 328 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 02a4d57...8673c49. Read the comment docs.

@gpsheadgpshead changed the title Fuzz struct.unpack and catch RecursionError in re.compilebpo-29505: Fuzz struct.unpack and catch RecursionError in re.compileFeb 28, 2020
@gpshead
gpshead merged commit e263bb1 into python:masterFeb 28, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@ammaraskar@gpshead@the-knights-who-say-ni@bedevere-bot