mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Issue #23908: os functions now reject paths with embedded null character
on Windows instead of silently truncate them.
This commit is contained in:
parent
2ef7c47844
commit
2b0d2007a1
4 changed files with 50 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue