mirror of
https://github.com/python/cpython.git
synced 2025-10-28 01:00:34 +00:00
[security] bpo-13617: Reject embedded null characters in wchar* strings. (#2302)
Based on patch by Victor Stinner. Add private C API function _PyUnicode_AsUnicode() which is similar to PyUnicode_AsUnicode(), but checks for null characters.
This commit is contained in:
parent
592eda1233
commit
f7eae0adfc
22 changed files with 115 additions and 23 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue