Skip to content

Commit

Permalink
pythongh-97758: Fix a crash in getpath_joinpath() called without argu…
Browse files Browse the repository at this point in the history
…ments (pythonGH-97759)
  • Loading branch information
serhiy-storchaka authored Oct 5, 2022
1 parent e3ef400 commit f8cbd79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Modules/getpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *));
Expand Down

0 comments on commit f8cbd79

Please sign in to comment.