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
845f7845
Commit
845f7845
authored
Jul 25, 2013
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #18556: Check the return value for PyUnicode_AsWideChar() in
U_set() from ctypes. CID #486657
parent
b76b1b1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_ctypes/cfield.c
Modules/_ctypes/cfield.c
+5
-1
No files found.
Misc/NEWS
View file @
845f7845
...
...
@@ -52,6 +52,9 @@ Core and Builtins
Library
-------
- Issue #18556: Check the return value of a PyUnicode_AsWideChar() call in
ctypes'
U_set
().
-
Issue
#
18549
:
Eliminate
dead
code
in
socket_ntohl
()
-
Issue
#
18514
:
Fix
unreachable
Py_DECREF
()
call
in
PyCData_FromBaseObj
()
...
...
Modules/_ctypes/cfield.c
View file @
845f7845
...
...
@@ -1260,7 +1260,11 @@ U_set(void *ptr, PyObject *value, Py_ssize_t length)
}
else
if
(
size
<
length
-
1
)
/* copy terminating NUL character if there is space */
size
+=
1
;
PyUnicode_AsWideChar
(
value
,
(
wchar_t
*
)
ptr
,
size
);
if
(
PyUnicode_AsWideChar
(
value
,
(
wchar_t
*
)
ptr
,
size
)
==
-
1
)
{
return
NULL
;
}
return
value
;
}
...
...
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