diff options
author | Raymond Hettinger <python@rcn.com> | 2015-08-26 15:08:38 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2015-08-26 15:08:38 (GMT) |
commit | 87674ec7d51eb99586231fbd6469b10d1f4fa111 (patch) | |
tree | a7230d39fc7176fcb1957713e819643bfe37cca1 /Modules/_collectionsmodule.c | |
parent | 9783e443bc0d653fcec508c501486f7f8ec39668 (diff) | |
download | cpython-87674ec7d51eb99586231fbd6469b10d1f4fa111.zip cpython-87674ec7d51eb99586231fbd6469b10d1f4fa111.tar.gz cpython-87674ec7d51eb99586231fbd6469b10d1f4fa111.tar.bz2 |
Issue #24913: Fix overrun error in deque.index().
Diffstat (limited to 'Modules/_collectionsmodule.c')
-rw-r--r-- | Modules/_collectionsmodule.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 830c5b8..3856d83 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) { |