diff Objects/typeobject.c @ 35637:7dd4e6cb9d27 legacy-trunk

(pedronis, arigo) segfault when a class contain a non-list value in the (undocumented) special attribute __slotnames__.
author Armin Rigo <arigo@tunes.org>
date Sat, 24 Sep 2005 22:58:41 +0000
parents 1f236e598ae9
children 1c4d192f1568
line wrap: on
line diff
--- a/Objects/typeobject.c	Sat Sep 24 21:23:05 2005 +0000
+++ b/Objects/typeobject.c	Sat Sep 24 22:58:41 2005 +0000
@@ -2522,7 +2522,7 @@
 
 	clsdict = ((PyTypeObject *)cls)->tp_dict;
 	slotnames = PyDict_GetItemString(clsdict, "__slotnames__");
-	if (slotnames != NULL) {
+	if (slotnames != NULL && PyList_Check(slotnames)) {
 		Py_INCREF(slotnames);
 		return slotnames;
 	}