diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2011-02-21 16:24:00 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2011-02-21 16:24:00 (GMT) |
commit | 5e06a5d4cdd1e2c0f41daedf6cfd5507fe76c773 (patch) | |
tree | 0f6d0bb2cce3e54bceb01afdca05d268e38a1c73 | |
parent | 2cebdd48657546bc89dd96e85210d3b56b302e8f (diff) | |
download | cpython-5e06a5d4cdd1e2c0f41daedf6cfd5507fe76c773.zip cpython-5e06a5d4cdd1e2c0f41daedf6cfd5507fe76c773.tar.gz cpython-5e06a5d4cdd1e2c0f41daedf6cfd5507fe76c773.tar.bz2 |
- Check for NULL result in PyType_FromSpec.
-rw-r--r-- | Misc/NEWS | 5 | ||||
-rw-r--r-- | Objects/typeobject.c | 2 |
2 files changed, 7 insertions, 0 deletions
@@ -7,6 +7,11 @@ What's New in Python 3.3 Alpha 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 b1fe44e..7a1aa77 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; |