mirror of
https://github.com/python/cpython.git
synced 2025-08-27 20:25:18 +00:00
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:
commit
7e9d1d1a1b
6 changed files with 50 additions and 28 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue