summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2015-08-26 08:08:38 -0700
committerRaymond Hettinger <python@rcn.com>2015-08-26 08:08:38 -0700
commitc4517b5e16e2d3c7092c3ffcb4bf8e751aa3d8f8 (patch)
treeb49ff3831badd246d6540c3c73706c239f6d89b1 /Modules
parent22fce54dfb7f9aeaec5da5b05299e4cbd27361dc (diff)
downloadcpython-c4517b5e16e2d3c7092c3ffcb4bf8e751aa3d8f8.tar.gz
Issue #24913: Fix overrun error in deque.index().
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_collectionsmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index 830c5b83eb..3856d83fb4 100644
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -924,6 +924,8 @@ deque_index(dequeobject *deque, PyObject *args)
if (stop < 0)
stop = 0;
}
+ if (stop > Py_SIZE(deque))
+ stop = Py_SIZE(deque);
for (i=0 ; i<stop ; i++) {
if (i >= start) {