mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Issue 2855: Fix obscure crasher by slowing down the entire module. Mimics what was done to dictionaries in r59223.
This commit is contained in:
parent
65856600ed
commit
d99bee7c9f
1 changed files with 4 additions and 0 deletions
|
|
@ -94,7 +94,9 @@ set_lookkey(PySetObject *so, PyObject *key, register long hash)
|
|||
else {
|
||||
if (entry->hash == hash) {
|
||||
startkey = entry->key;
|
||||
Py_INCREF(startkey);
|
||||
cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
|
||||
Py_DECREF(startkey);
|
||||
if (cmp < 0)
|
||||
return NULL;
|
||||
if (table == so->table && entry->key == startkey) {
|
||||
|
|
@ -125,7 +127,9 @@ set_lookkey(PySetObject *so, PyObject *key, register long hash)
|
|||
break;
|
||||
if (entry->hash == hash && entry->key != dummy) {
|
||||
startkey = entry->key;
|
||||
Py_INCREF(startkey);
|
||||
cmp = PyObject_RichCompareBool(startkey, key, Py_EQ);
|
||||
Py_DECREF(startkey);
|
||||
if (cmp < 0)
|
||||
return NULL;
|
||||
if (table == so->table && entry->key == startkey) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue