summaryrefslogtreecommitdiff
path: root/Lib/test/crashers
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2007-05-02 19:23:31 +0000
committerArmin Rigo <arigo@tunes.org>2007-05-02 19:23:31 +0000
commit9790a2706573359e02fcfc5f18f9907467f4ec49 (patch)
treed953c06fbbb8325b8ed86e707ed17f0b43b870dd /Lib/test/crashers
parentd83eb316dce49606041304afb6b68e85fb1794af (diff)
downloadcpython-git-9790a2706573359e02fcfc5f18f9907467f4ec49.tar.gz
Fix for #1303614 and #1174712:
- __dict__ descriptor abuse for subclasses of built-in types - subclassing from both ModuleType and another built-in types Thanks zseil for the patch.
Diffstat (limited to 'Lib/test/crashers')
-rw-r--r--Lib/test/crashers/dangerous_subclassing.py12
-rw-r--r--Lib/test/crashers/modify_dict_attr.py20
2 files changed, 0 insertions, 32 deletions
diff --git a/Lib/test/crashers/dangerous_subclassing.py b/Lib/test/crashers/dangerous_subclassing.py
deleted file mode 100644
index 0479952b2c..0000000000
--- a/Lib/test/crashers/dangerous_subclassing.py
+++ /dev/null
@@ -1,12 +0,0 @@
-
-# http://python.org/sf/1174712
-
-import types
-
-class X(types.ModuleType, str):
- """Such a subclassing is incorrectly allowed --
- see the SF bug report for explanations"""
-
-if __name__ == '__main__':
- X('name') # segfault: ModuleType.__init__() reads
- # the dict at the wrong offset
diff --git a/Lib/test/crashers/modify_dict_attr.py b/Lib/test/crashers/modify_dict_attr.py
deleted file mode 100644
index 11c672106a..0000000000
--- a/Lib/test/crashers/modify_dict_attr.py
+++ /dev/null
@@ -1,20 +0,0 @@
-
-# http://python.org/sf/1303614
-
-class Y(object):
- pass
-
-class type_with_modifiable_dict(type, Y):
- pass
-
-class MyClass(object):
- """This class has its __dict__ attribute indirectly
- exposed via the __dict__ getter/setter of Y.
- """
- __metaclass__ = type_with_modifiable_dict
-
-
-if __name__ == '__main__':
- dictattr = Y.__dict__['__dict__']
- dictattr.__delete__(MyClass) # if we set tp_dict to NULL,
- print MyClass # doing anything with MyClass segfaults