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
a48aa85d
Commit
a48aa85d
authored
Jun 03, 2016
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check the result of PyByteArray_Resize in readline() (closes #27211)
parent
bbf29ee6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
Misc/NEWS
Misc/NEWS
+2
-0
Modules/_io/iobase.c
Modules/_io/iobase.c
+4
-1
No files found.
Misc/NEWS
View file @
a48aa85d
...
...
@@ -89,6 +89,8 @@ Core and Builtins
Library
-------
-
Issue
#
27211
:
Fix
possible
memory
corruption
in
io
.
IOBase
.
readline
().
-
Issue
#
27114
:
Fix
SSLContext
.
_load_windows_store_certs
fails
with
PermissionError
...
...
Modules/_io/iobase.c
View file @
a48aa85d
...
...
@@ -529,7 +529,10 @@ iobase_readline(PyObject *self, PyObject *args)
}
old_size
=
PyByteArray_GET_SIZE
(
buffer
);
PyByteArray_Resize
(
buffer
,
old_size
+
PyBytes_GET_SIZE
(
b
));
if
(
PyByteArray_Resize
(
buffer
,
old_size
+
PyBytes_GET_SIZE
(
b
))
<
0
)
{
Py_DECREF
(
b
);
goto
fail
;
}
memcpy
(
PyByteArray_AS_STRING
(
buffer
)
+
old_size
,
PyBytes_AS_STRING
(
b
),
PyBytes_GET_SIZE
(
b
));
...
...
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