Skip to content

Commit dc78cc6

Browse files
committed
Fix bug in marshal where bad data would cause a segfault due to
lack of an infinite recursion check. Contributed by Damien Miller at Google.
1 parent 4043a6b commit dc78cc6

4 files changed

Lines changed: 164 additions & 69 deletions

File tree

‎Lib/test/test_marshal.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ def test_fuzz(self):
220220
except Exception:
221221
pass
222222

223+
def test_recursion(self):
224+
s = 'c' + ('X' * 4*4) + '{' * 2**20
225+
self.assertRaises(ValueError, marshal.loads, s)
226+
223227
def test_main():
224228
test_support.run_unittest(IntTestCase,
225229
FloatTestCase,

‎Misc/ACKS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ Dieter Maurer
413413
Greg McFarlane
414414
Michael McLay
415415
Gordon McMillan
416+
Damien Miller
416417
Jay T. Miller
417418
Chris McDonough
418419
Andrew McNamara

‎Misc/NEWS‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ What's New in Python 2.5.2c1?
1212
Library
1313
-------
1414

15+
- Fix bug in marshal where bad data would cause a segfault due to
16+
lack of an infinite recursion check.
17+
1518
- HTML-escape the plain traceback in cgitb's HTML output, to prevent
1619
the traceback inadvertently or maliciously closing the comment and
1720
injecting HTML into the error page.

0 commit comments

Comments
 (0)