summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-06-27 18:08:58 (GMT)
committerGitHub <noreply@github.com>2017-06-27 18:08:58 (GMT)
commit0edffa3073b551ffeca34952529e7b292f1bd350 (patch)
treedcbf750061bcbe9da3ae9401292185b44490bb4b /Include
parent35d2ca2b94a6ff29e763ddb7727166f0592edfa2 (diff)
downloadcpython-0edffa3073b551ffeca34952529e7b292f1bd350.zip
cpython-0edffa3073b551ffeca34952529e7b292f1bd350.tar.gz
cpython-0edffa3073b551ffeca34952529e7b292f1bd350.tar.bz2
[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 e613e6add5f07ff6aad5802924596b631b707d2a)
Diffstat (limited to 'Include')
-rw-r--r--Include/unicodeobject.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 5b87718..cec2b7f 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -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