mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
gh-97758: Fix a crash in getpath_joinpath() called without arguments (GH-97759)
(cherry picked from commit f8cbd79d32
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
79b5c1ad3c
commit
73e3510bdb
1 changed files with 1 additions and 1 deletions
|
@ -261,7 +261,7 @@ getpath_joinpath(PyObject *Py_UNUSED(self), PyObject *args)
|
|||
}
|
||||
Py_ssize_t n = PyTuple_GET_SIZE(args);
|
||||
if (n == 0) {
|
||||
return PyUnicode_FromString(NULL);
|
||||
return PyUnicode_FromStringAndSize(NULL, 0);
|
||||
}
|
||||
/* Convert all parts to wchar and accumulate max final length */
|
||||
wchar_t **parts = (wchar_t **)PyMem_Malloc(n * sizeof(wchar_t *));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue