mirror of
https://github.com/python/cpython.git
synced 2025-10-03 21:55:41 +00:00
[3.6] bpo-30708: Check for null characters in PyUnicode_AsWideCharString(). (GH-2285) (#2443)
Raise a ValueError if the second argument is NULL and the wchar_t\*
string contains null characters..
(cherry picked from commit e613e6add5
)
This commit is contained in:
parent
35d2ca2b94
commit
0edffa3073
12 changed files with 50 additions and 20 deletions
|
@ -1063,6 +1063,12 @@ PyAPI_FUNC(wchar_t*) PyUnicode_AsWideCharString(
|
|||
);
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
/* Similar to PyUnicode_AsWideCharString(unicode, NULL), but check if
|
||||
the string contains null characters. */
|
||||
PyAPI_FUNC(wchar_t*) _PyUnicode_AsWideCharString(
|
||||
PyObject *unicode /* Unicode object */
|
||||
);
|
||||
|
||||
PyAPI_FUNC(void*) _PyUnicode_AsKind(PyObject *s, unsigned int kind);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue