[issue8420] Objects/setobject.c contains unsafe code

Raymond Hettinger report at bugs.python.org
Sun Apr 18 19:33:18 CEST 2010


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

> One solution is to check that so->mask didn't 
> change as well. 

I saw that and agree it would make a tighter check, but haven't convinced myself that it is necessary.

> Also, checking that refcnt > 1 is redundant 
> because if entry->key == startkey then there 
> are at least two references: one from entry->key 
> and another from startkey.

It is a meaningful check.  We have our own INCREF
and one for the key being in the table.  If the
count is 1, then it means that the comparison
check deleted the key from the table or replaced
its value (see issue 1517).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8420>
_______________________________________


More information about the Python-bugs-list mailing list