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
7dc18a70
Commit
7dc18a70
authored
Mar 02, 2015
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use PyMem_NEW to detect overflow (closes #23362)
parent
73c1241f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
Objects/unicodeobject.c
Objects/unicodeobject.c
+1
-1
No files found.
Objects/unicodeobject.c
View file @
7dc18a70
...
@@ -8501,7 +8501,7 @@ _PyUnicode_TranslateCharmap(PyObject *input,
...
@@ -8501,7 +8501,7 @@ _PyUnicode_TranslateCharmap(PyObject *input,
/* allocate enough for a simple 1:1 translation without
/* allocate enough for a simple 1:1 translation without
replacements, if we need more, we'll resize */
replacements, if we need more, we'll resize */
osize
=
size
;
osize
=
size
;
output
=
PyMem_
Malloc
(
osize
*
sizeof
(
Py_UCS4
)
);
output
=
PyMem_
NEW
(
Py_UCS4
,
osize
);
opos
=
0
;
opos
=
0
;
if
(
output
==
NULL
)
{
if
(
output
==
NULL
)
{
PyErr_NoMemory
();
PyErr_NoMemory
();
...
...
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