From 0834905d9b61291b1fc5e05a1ffbc69de9c9379f Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 28 Jun 2017 09:27:35 +0300 Subject: [3.6] bpo-13617: Reject embedded null characters in wchar* strings. (GH-2302) (#2462) Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.. (cherry picked from commit f7eae0adfcd4c50034281b2c69f461b43b68db84) --- Python/dynload_win.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Python/dynload_win.c') diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 05050cf41d..0fdf77f552 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -190,13 +190,13 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, { dl_funcptr p; char funcname[258], *import_python; - wchar_t *wpathname; + const wchar_t *wpathname; #ifndef _DEBUG _Py_CheckPython3(); #endif - wpathname = PyUnicode_AsUnicode(pathname); + wpathname = _PyUnicode_AsUnicode(pathname); if (wpathname == NULL) return NULL; -- cgit v1.2.1