Skip to content

Commit 41a73a4

Browse files
committedOct 3, 2022
pythongh-97758: Fix a crash in getpath_joinpath() called without arguments
1 parent 0ee9619 commit 41a73a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎Modules/getpath.c

+1-1
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)
Please sign in to comment.