Mercurial > cpython-lru_cache-weakref
diff Objects/tupleobject.c @ 25742:396c8a24880c 2.2
Backport listobject.c 2.137 and tupleobject.c 2.75:
Add checks for size overflow on list*n, list+list, tuple+tuple.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 11 Oct 2002 21:13:14 +0000 |
| parents | 0446eeb787b7 |
| children |
line wrap: on
line diff
--- a/Objects/tupleobject.c Fri Oct 11 20:59:57 2002 +0000 +++ b/Objects/tupleobject.c Fri Oct 11 21:13:14 2002 +0000 @@ -337,6 +337,8 @@ } #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;
