From 7be5b78b4f06bfbb07dccb054ad4855d48c7bccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Mon, 21 Feb 2011 16:26:47 +0000 Subject: [PATCH] Merged revisions 88456 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88456 | martin.v.loewis | 2011-02-21 17:24:00 +0100 (Mo, 21 Feb 2011) | 2 lines - Check for NULL result in PyType_FromSpec. ........ --- Misc/NEWS | 11 +++++++++++ Objects/typeobject.c | 2 ++ 2 files changed, 13 insertions(+) diff --git a/Misc/NEWS b/Misc/NEWS index c34a540820e..dbbf2d2f2bf 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -2,6 +2,17 @@ Python News +++++++++++ +What's New in Python 3.2.1? +=========================== + +*Release date: XX-XXX-20XX* + +Core and Builtins +----------------- + +- Check for NULL result in PyType_FromSpec. + + What's New in Python 3.2? ========================= diff --git a/Objects/typeobject.c b/Objects/typeobject.c index b1fe44ebe48..7a1aa77e3f7 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2330,6 +2330,8 @@ PyObject* PyType_FromSpec(PyType_Spec *spec) char *res_start = (char*)res; PyType_Slot *slot; + if (res == NULL) + return NULL; res->ht_name = PyUnicode_FromString(spec->name); if (!res->ht_name) goto fail;