--- Objects/exceptions.c.orig 2006-09-09 09:18:44.000000000 +0200 +++ Objects/exceptions.c 2007-04-10 21:25:09.000000000 +0200 @@ -33,6 +33,10 @@ PyBaseExceptionObject *self; self = (PyBaseExceptionObject *)type->tp_alloc(type, 0); + if (self == NULL) { + return NULL; + } + /* the dict is created on the fly in PyObject_GenericSetAttr */ self->message = self->dict = NULL; --- Objects/object.c.orig 2006-08-14 12:55:19.000000000 +0200 +++ Objects/object.c 2007-04-10 21:32:06.000000000 +0200 @@ -1284,7 +1284,9 @@ /* Look in tp_dict of types in MRO */ mro = tp->tp_mro; - assert(mro != NULL); + if (mro == NULL) { + goto done; + } assert(PyTuple_Check(mro)); n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { --- Objects/longobject.c.orig 2006-08-12 19:03:09.000000000 +0200 +++ Objects/longobject.c 2007-04-10 21:34:50.000000000 +0200 @@ -2511,6 +2511,11 @@ if (long_divrem(v, w, &div, &mod) < 0) return -1; + if (div == NULL || mod == NULL) { + Py_XDECREF(div); + Py_XDECREF(mod); + return -1; + } if ((mod->ob_size < 0 && w->ob_size > 0) || (mod->ob_size > 0 && w->ob_size < 0)) { PyLongObject *temp;