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
c3c9db89
Commit
c3c9db89
authored
Jun 18, 2017
by
Jay Bosamiya
Committed by
Serhiy Storchaka
Jun 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.7] bpo-30657: Check & prevent integer overflow in PyString_DecodeEscape (#2174)
parent
24c2c208
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
Objects/stringobject.c
Objects/stringobject.c
+7
-1
No files found.
Misc/ACKS
View file @
c3c9db89
...
@@ -152,6 +152,7 @@ Gregory Bond
...
@@ -152,6 +152,7 @@ Gregory Bond
Matias Bordese
Matias Bordese
Jonas Borgström
Jonas Borgström
Jurjen Bos
Jurjen Bos
Jay Bosamiya
Peter Bosch
Peter Bosch
Dan Boswell
Dan Boswell
Eric Bouck
Eric Bouck
...
...
Misc/NEWS
View file @
c3c9db89
...
@@ -10,6 +10,9 @@ What's New in Python 2.7.14?
...
@@ -10,6 +10,9 @@ What's New in Python 2.7.14?
Core and Builtins
Core and Builtins
-----------------
-----------------
- bpo-30657: Fixed possible integer overflow in PyString_DecodeEscape.
Patch by Jay Bosamiya.
- bpo-27945: Fixed various segfaults with dict when input collections are
- bpo-27945: Fixed various segfaults with dict when input collections are
mutated during searching, inserting or comparing. Based on patches by
mutated during searching, inserting or comparing. Based on patches by
Duane Griffin and Tim Mitchell.
Duane Griffin and Tim Mitchell.
...
...
Objects/stringobject.c
View file @
c3c9db89
...
@@ -612,7 +612,13 @@ PyObject *PyString_DecodeEscape(const char *s,
...
@@ -612,7 +612,13 @@ PyObject *PyString_DecodeEscape(const char *s,
char
*
p
,
*
buf
;
char
*
p
,
*
buf
;
const
char
*
end
;
const
char
*
end
;
PyObject
*
v
;
PyObject
*
v
;
Py_ssize_t
newlen
=
recode_encoding
?
4
*
len
:
len
;
Py_ssize_t
newlen
;
/* Check for integer overflow */
if
(
recode_encoding
&&
(
len
>
PY_SSIZE_T_MAX
/
4
))
{
PyErr_SetString
(
PyExc_OverflowError
,
"string is too large"
);
return
NULL
;
}
newlen
=
recode_encoding
?
4
*
len
:
len
;
v
=
PyString_FromStringAndSize
((
char
*
)
NULL
,
newlen
);
v
=
PyString_FromStringAndSize
((
char
*
)
NULL
,
newlen
);
if
(
v
==
NULL
)
if
(
v
==
NULL
)
return
NULL
;
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