Kaydet (Commit) a5846641 authored tarafından Trent Mick's avatar Trent Mick

Check for overflow in list object insertion and raise OverflowError.

see: http://www.python.org/pipermail/python-dev/2000-August/014971.html
üst 87df80d5
......@@ -134,6 +134,11 @@ ins1(PyListObject *self, int where, PyObject *v)
PyErr_BadInternalCall();
return -1;
}
if (self->ob_size == INT_MAX) {
PyErr_SetString(PyExc_OverflowError,
"cannot add more objects to list");
return -1;
}
items = self->ob_item;
NRESIZE(items, PyObject *, self->ob_size+1);
if (items == NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment