From: Armin Rigo Date: Sat, 24 Sep 2005 22:58:41 +0000 (+0000) Subject: (pedronis, arigo) X-Git-Tag: v2.5a0~1338 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ec862b907aff99a4f256b946764f349f4d1d0c5c;p=thirdparty%2FPython%2Fcpython.git (pedronis, arigo) segfault when a class contain a non-list value in the (undocumented) special attribute __slotnames__. --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 41488a4a186c..88c4a15d6753 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2522,7 +2522,7 @@ slotnames(PyObject *cls) clsdict = ((PyTypeObject *)cls)->tp_dict; slotnames = PyDict_GetItemString(clsdict, "__slotnames__"); - if (slotnames != NULL) { + if (slotnames != NULL && PyList_Check(slotnames)) { Py_INCREF(slotnames); return slotnames; }