Message103424
I've found more unsafe code in Objects/setobject.c.
This code makes Python 3.1.2 segfault by using a bug in function set_merge:
class bad:
def __eq__(self, other):
if be_bad:
set2.clear()
raise Exception
return self is other
def __hash__(self):
return 0
be_bad = False
set1 = {bad()}
set2 = {bad() for i in range(2000)}
be_bad = True
set1.update(set2)
Function set_symmetric_difference_update has a similar bug.
Another bug in set_symmetric_difference_update:
class bad:
def __init__(self):
print("Creating", id(self))
def __del__(self):
print("Deleting", id(self))
def __eq__(self, other):
print("Comparing", id(self), "and", id(other))
if be_bad:
dict2.clear()
return self is other
def __hash__(self):
return 0
be_bad = False
set1 = {bad()}
dict2 = {bad(): None}
be_bad = True
set1.symmetric_difference_update(dict2) |
|
Date |
User |
Action |
Args |
2010-04-17 19:05:38 | abacabadabacaba | set | recipients:
+ abacabadabacaba, rhettinger |
2010-04-17 19:05:38 | abacabadabacaba | set | messageid: <1271531138.23.0.461760123126.issue8420@psf.upfronthosting.co.za> |
2010-04-17 19:05:36 | abacabadabacaba | link | issue8420 messages |
2010-04-17 19:05:36 | abacabadabacaba | create | |
|