Issue #23908: os functions now reject paths with embedded null character

on Windows instead of silently truncate them.
This commit is contained in:
Serhiy Storchaka 2015-04-20 09:53:58 +03:00
parent 2ef7c47844
commit 2b0d2007a1
4 changed files with 50 additions and 7 deletions

View file

@ -858,6 +858,11 @@ path_converter(PyObject *o, void *p) {
Py_DECREF(unicode);
return 0;
}
if (wcslen(wide) != length) {
FORMAT_EXCEPTION(PyExc_TypeError, "embedded null character");
Py_DECREF(unicode);
return 0;
}
path->wide = wide;
path->narrow = NULL;