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
04a53853
Commit
04a53853
authored
Aug 13, 2016
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix possible overflow in encode_basestring_ascii (#23369)
parent
4ae4e7cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_json.c
Modules/_json.c
+4
-0
No files found.
Misc/NEWS
View file @
04a53853
...
...
@@ -29,6 +29,9 @@ Core and Builtins
Library
-------
-
Issue
#
23369
:
Fixed
possible
integer
overflow
in
_json
.
encode_basestring_ascii
.
-
Issue
#
27568
:
Prevent
HTTPoxy
attack
(
CVE
-
2016
-
1000110
).
Ignore
the
HTTP_PROXY
variable
when
REQUEST_METHOD
environment
is
set
,
which
indicates
that
the
script
is
in
CGI
mode
.
...
...
Modules/_json.c
View file @
04a53853
...
...
@@ -211,6 +211,10 @@ ascii_escape_unicode(PyObject *pystr)
input_unicode
=
PyUnicode_AS_UNICODE
(
pystr
);
/* One char input can be up to 6 chars output, estimate 4 of these */
if
(
input_chars
>
(
PY_SSIZE_T_MAX
-
2
)
/
MAX_EXPANSION
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"string is too long to escape"
);
return
NULL
;
}
output_size
=
2
+
(
MIN_EXPANSION
*
4
)
+
input_chars
;
max_output_size
=
2
+
(
input_chars
*
MAX_EXPANSION
);
rval
=
PyString_FromStringAndSize
(
NULL
,
output_size
);
...
...
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