summaryrefslogtreecommitdiff
path: root/Objects/listobject.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-02-02 22:55:09 +0000
committerRaymond Hettinger <python@rcn.com>2009-02-02 22:55:09 +0000
commit7763fc8702c47cea6286b5616969cde2e480b7f9 (patch)
tree6f46b2544302a1d8d50fa458ce6d55cb6c08ac7d /Objects/listobject.c
parent69cca7f026e0ba7ca5f8b915a60e4bf6886f030a (diff)
downloadcpython-7763fc8702c47cea6286b5616969cde2e480b7f9.tar.gz
Issue 1242657: list(obj) can swallow KeyboardInterrupt.
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index b8343631f4..2bab4ef26b 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -802,6 +802,10 @@ listextend(PyListObject *self, PyObject *b)
/* Guess a result list size. */
n = _PyObject_LengthHint(b, 8);
+ if (n == -1) {
+ Py_DECREF(it);
+ return NULL;
+ }
m = Py_SIZE(self);
mn = m + n;
if (mn >= m) {