Security patches from Apple: prevent int overflow when allocating memory

This commit is contained in:
Neal Norwitz 2008-07-31 17:17:14 +00:00
parent e70f8e1205
commit e7d8be80ba
13 changed files with 258 additions and 29 deletions

View file

@ -70,6 +70,8 @@ _PyLong_New(Py_ssize_t size)
return NULL;
}
/* coverity[ampersand_in_size] */
/* XXX(nnorwitz): This can overflow --
PyObject_NEW_VAR / _PyObject_VAR_SIZE need to detect overflow */
return PyObject_NEW_VAR(PyLongObject, &PyLong_Type, size);
}