diff options
author | Guido van Rossum <guido@python.org> | 2002-10-11 21:05:56 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-10-11 21:05:56 (GMT) |
commit | a5c0e6d6c8e3513017009796ff34bb9c14512559 (patch) | |
tree | fbaef612dddda4c7e7521ff184270d96ea427cf5 /Objects/tupleobject.c | |
parent | 6e08c1460c79962a98e106437a089d2fe306403c (diff) | |
download | cpython-a5c0e6d6c8e3513017009796ff34bb9c14512559.zip cpython-a5c0e6d6c8e3513017009796ff34bb9c14512559.tar.gz cpython-a5c0e6d6c8e3513017009796ff34bb9c14512559.tar.bz2 |
Add checks for size overflow on list*n, list+list, tuple+tuple.
Will backport.
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r-- | Objects/tupleobject.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 6c2162a..3a8f072 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -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; |