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

@ -3606,21 +3606,6 @@ PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
}
int
_PyUnicode_HasNULChars(PyObject* str)
{
Py_ssize_t pos;
if (PyUnicode_READY(str) == -1)
return -1;
pos = findchar(PyUnicode_DATA(str), PyUnicode_KIND(str),
PyUnicode_GET_LENGTH(str), '\0', 1);
if (pos == -1)
return 0;
else
return 1;
}
int
PyUnicode_FSConverter(PyObject* arg, void* addr)
{