Skip to content

Commit f8cbd79

Browse files
gh-97758: Fix a crash in getpath_joinpath() called without arguments (GH-97759)
1 parent e3ef400 commit f8cbd79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/getpath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ getpath_joinpath(PyObject *Py_UNUSED(self), PyObject *args)
261261
}
262262
Py_ssize_t n = PyTuple_GET_SIZE(args);
263263
if (n == 0) {
264-
return PyUnicode_FromString(NULL);
264+
return PyUnicode_FromStringAndSize(NULL, 0);
265265
}
266266
/* Convert all parts to wchar and accumulate max final length */
267267
wchar_t **parts = (wchar_t **)PyMem_Malloc(n * sizeof(wchar_t *));

0 commit comments

Comments
 (0)