summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 42eedf2..2b016ed 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -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) {