summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index dcd7b5e..05dddfc 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -804,6 +804,9 @@ listextend(PyListObject *self, PyObject *b)
Py_RETURN_NONE;
}
m = Py_SIZE(self);
+ /* It should not be possible to allocate a list large enough to cause
+ an overflow on any relevant platform */
+ assert(m < PY_SSIZE_T_MAX - n);
if (list_resize(self, m + n) < 0) {
Py_DECREF(b);
return NULL;