Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
87674ec7
Commit
87674ec7
authored
Aug 26, 2015
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #24913: Fix overrun error in deque.index().
parent
9783e443
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
Lib/test/test_deque.py
Lib/test/test_deque.py
+5
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_collectionsmodule.c
Modules/_collectionsmodule.c
+2
-0
No files found.
Lib/test/test_deque.py
View file @
87674ec7
...
...
@@ -289,6 +289,11 @@ class TestBasic(unittest.TestCase):
else
:
self
.
assertEqual
(
d
.
index
(
element
,
start
,
stop
),
target
)
def
test_insert_bug_24913
(
self
):
d
=
deque
(
'A'
*
3
)
with
self
.
assertRaises
(
ValueError
):
i
=
d
.
index
(
"Hello world"
,
0
,
4
)
def
test_insert
(
self
):
# Test to make sure insert behaves like lists
elements
=
'ABCDEFGHI'
...
...
Misc/NEWS
View file @
87674ec7
...
...
@@ -18,6 +18,9 @@ Library
header in part headers. Patch written by Peter Landry and reviewed by Pierre
Quentel.
- Issue #24913: Fix overrun error in deque.index().
Found by John Leitch and Bryce Darling.
- Issue #24774: Fix docstring in http.server.test. Patch from Chiu-Hsiang Hsu.
- Issue #21159: Improve message in configparser.InterpolationMissingOptionError.
...
...
Modules/_collectionsmodule.c
View file @
87674ec7
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment