]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
(pedronis, arigo)
authorArmin Rigo <arigo@tunes.org>
Sat, 24 Sep 2005 22:58:41 +0000 (22:58 +0000)
committerArmin Rigo <arigo@tunes.org>
Sat, 24 Sep 2005 22:58:41 +0000 (22:58 +0000)
segfault when a class contain a non-list value in the (undocumented)
special attribute __slotnames__.

Objects/typeobject.c

index 41488a4a186c8cbc43a836ea6d38e1973be2fc8c..88c4a15d6753c19af595767f7c21257e901069ec 100644 (file)
@@ -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;
        }