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
414b1cde
Commit
414b1cde
authored
Mar 26, 2019
by
Victor Stinner
Committed by
GitHub
Mar 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-36436: Fix _testcapi.pymem_buffer_overflow() (GH-12560)
Handle memory allocation failure.
parent
871309c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
Misc/NEWS.d/next/Tests/2019-03-26-13-49-21.bpo-36436.yAtN0V.rst
...EWS.d/next/Tests/2019-03-26-13-49-21.bpo-36436.yAtN0V.rst
+1
-0
Modules/_testcapimodule.c
Modules/_testcapimodule.c
+4
-0
No files found.
Misc/NEWS.d/next/Tests/2019-03-26-13-49-21.bpo-36436.yAtN0V.rst
0 → 100644
View file @
414b1cde
Fix ``_testcapi.pymem_buffer_overflow()``: handle memory allocation failure.
Modules/_testcapimodule.c
View file @
414b1cde
...
...
@@ -4184,6 +4184,10 @@ pymem_buffer_overflow(PyObject *self, PyObject *args)
/* Deliberate buffer overflow to check that PyMem_Free() detects
the overflow when debug hooks are installed. */
buffer
=
PyMem_Malloc
(
16
);
if
(
buffer
==
NULL
)
{
PyErr_NoMemory
();
return
NULL
;
}
buffer
[
16
]
=
'x'
;
PyMem_Free
(
buffer
);
...
...
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