Kaydet (Commit) eb909469 authored tarafından Guido van Rossum's avatar Guido van Rossum

Some robustness checks in Py_ReprLeave() in the unlikely event someone

has messed with the dictionary or list.
üst 8f6b958f
......@@ -844,7 +844,11 @@ Py_ReprLeave(obj)
int i;
dict = PyThreadState_GetDict();
if (dict == NULL)
return;
list = PyDict_GetItemString(dict, KEY);
if (list == NULL || !PyList_Check(list))
return;
i = PyList_GET_SIZE(list);
/* Count backwards because we always expect obj to be list[-1] */
while (--i >= 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment