diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-02-20 01:36:12 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-02-20 01:36:12 (GMT) |
commit | 006c5a22354ea73ee26163a957782115cef25f8f (patch) | |
tree | 930a78d63729b84f209ee97cbdfb662c8c24f9e0 | |
parent | 23d7f12ffb8983fa670ef289a03c3d55153f37ce (diff) | |
download | cpython-006c5a22354ea73ee26163a957782115cef25f8f.zip cpython-006c5a22354ea73ee26163a957782115cef25f8f.tar.gz cpython-006c5a22354ea73ee26163a957782115cef25f8f.tar.bz2 |
check for NULL to fix segfault
-rw-r--r-- | Objects/typeobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index a5abcce..9aa752e 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1807,7 +1807,7 @@ subtype_setdict(PyObject *obj, PyObject *value, void *context) "This object has no __dict__"); return -1; } - if (!PyDict_Check(value)) { + if (value != NULL && !PyDict_Check(value)) { PyErr_Format(PyExc_TypeError, "__dict__ must be set to a dictionary, " "not a '%.200s'", Py_TYPE(value)->tp_name); |