summaryrefslogtreecommitdiffstats
path: root/Lib/test/crashers
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2006-06-01 13:19:12 (GMT)
committerArmin Rigo <arigo@tunes.org>2006-06-01 13:19:12 (GMT)
commit35f6d36951766c8ca7a88642415e76a603751878 (patch)
treed75f5ffac6c764c9485f6134f4d3d2c3fc1081a1 /Lib/test/crashers
parente08940ef6c93e89c5a9163e8e433cb53a894dd56 (diff)
downloadcpython-35f6d36951766c8ca7a88642415e76a603751878.zip
cpython-35f6d36951766c8ca7a88642415e76a603751878.tar.gz
cpython-35f6d36951766c8ca7a88642415e76a603751878.tar.bz2
[ 1497053 ] Let dicts propagate the exceptions in user __eq__().
[ 1456209 ] dictresize() vulnerability ( <- backport candidate ).
Diffstat (limited to 'Lib/test/crashers')
-rw-r--r--Lib/test/crashers/dictresize_attack.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/Lib/test/crashers/dictresize_attack.py b/Lib/test/crashers/dictresize_attack.py
deleted file mode 100644
index 1895791..0000000
--- a/Lib/test/crashers/dictresize_attack.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# http://www.python.org/sf/1456209
-
-# A dictresize() attack. If oldtable == mp->ma_smalltable then pure
-# Python code can mangle with mp->ma_smalltable while it is being walked
-# over.
-
-class X(object):
-
- def __hash__(self):
- return 5
-
- def __eq__(self, other):
- if resizing:
- d.clear()
- return False
-
-
-d = {}
-
-resizing = False
-
-d[X()] = 1
-d[X()] = 2
-d[X()] = 3
-d[X()] = 4
-d[X()] = 5
-
-# now trigger a resize
-resizing = True
-d[9] = 6
-
-# ^^^ I get Segmentation fault or Illegal instruction here.