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

on Windows instead of silently truncate them.

Removed no longer used _PyUnicode_HasNULChars().
This commit is contained in:
Serhiy Storchaka 2015-04-20 10:12:28 +03:00
commit 7e9d1d1a1b
6 changed files with 50 additions and 28 deletions

View file

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