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
156285c3
Commit
156285c3
authored
Apr 13, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Plain Diff
merge 3.2
parents
f5c34054
99b5afab
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
1 deletion
+12
-1
Lib/test/test_json/test_decode.py
Lib/test/test_json/test_decode.py
+4
-0
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_json.c
Modules/_json.c
+4
-1
No files found.
Lib/test/test_json/test_decode.py
View file @
156285c3
...
...
@@ -70,5 +70,9 @@ class TestDecode:
msg
=
'escape'
self
.
assertRaisesRegex
(
ValueError
,
msg
,
self
.
loads
,
s
)
def
test_negative_index
(
self
):
d
=
self
.
json
.
JSONDecoder
()
self
.
assertRaises
(
ValueError
,
d
.
raw_decode
,
'a'
*
42
,
-
50000
)
class
TestPyDecode
(
TestDecode
,
PyTest
):
pass
class
TestCDecode
(
TestDecode
,
CTest
):
pass
Misc/ACKS
View file @
156285c3
...
...
@@ -1313,6 +1313,7 @@ Johannes Vogel
Alex Volkov
Martijn Vries
Sjoerd de Vries
Guido Vranken
Niki W. Waibel
Wojtek Walczak
Charles Waldman
...
...
Misc/NEWS
View file @
156285c3
...
...
@@ -13,6 +13,9 @@ Core and Builtins
Library
-------
- Fix arbitrary memory access in JSONDecoder.raw_decode with a negative second
parameter. Bug reported by Guido Vranken.
- Issue #20633: Replace relative import by absolute import.
- Issue #21082: In os.makedirs, do not set the process-wide umask. Note this
...
...
Modules/_json.c
View file @
156285c3
...
...
@@ -975,7 +975,10 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_
kind
=
PyUnicode_KIND
(
pystr
);
length
=
PyUnicode_GET_LENGTH
(
pystr
);
if
(
idx
>=
length
)
{
if
(
idx
<
0
)
/* Compatibility with Python version. */
idx
+=
length
;
if
(
idx
<
0
||
idx
>=
length
)
{
PyErr_SetNone
(
PyExc_StopIteration
);
return
NULL
;
}
...
...
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