Add checks for size overflow on list*n, list+list, tuple+tuple.

Will backport.
This commit is contained in:
Guido van Rossum 2002-10-11 21:05:56 +00:00
parent 6e08c1460c
commit a5c0e6d6c8
2 changed files with 6 additions and 0 deletions

View file

@ -330,6 +330,8 @@ tupleconcat(register PyTupleObject *a, register PyObject *bb)
}
#define b ((PyTupleObject *)bb)
size = a->ob_size + b->ob_size;
if (size < 0)
return PyErr_NoMemory();
np = (PyTupleObject *) PyTuple_New(size);
if (np == NULL) {
return NULL;