summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2005-09-24 22:58:41 (GMT)
committerArmin Rigo <arigo@tunes.org>2005-09-24 22:58:41 (GMT)
commitec862b907aff99a4f256b946764f349f4d1d0c5c (patch)
tree27fc76933fa062bf8df463f2f3382204faa59a6f
parent6b27cda64386195cd07dfb686e9486f1c4bc3159 (diff)
downloadcpython-ec862b907aff99a4f256b946764f349f4d1d0c5c.zip
cpython-ec862b907aff99a4f256b946764f349f4d1d0c5c.tar.gz
cpython-ec862b907aff99a4f256b946764f349f4d1d0c5c.tar.bz2
(pedronis, arigo)
segfault when a class contain a non-list value in the (undocumented) special attribute __slotnames__.
-rw-r--r--Objects/typeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 41488a4..88c4a15 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;
}