mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
Add some missing NULL checks which trigger crashes on low-memory conditions.
Found by Victor Stinner. Will backport when 2.5 branch is unfrozen.
This commit is contained in:
parent
5bf02cd17f
commit
c02e13122b
2 changed files with 10 additions and 0 deletions
|
@ -33,6 +33,8 @@ BaseException_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
PyBaseExceptionObject *self;
|
||||
|
||||
self = (PyBaseExceptionObject *)type->tp_alloc(type, 0);
|
||||
if (!self)
|
||||
return NULL;
|
||||
/* the dict is created on the fly in PyObject_GenericSetAttr */
|
||||
self->message = self->dict = NULL;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue