summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-10-05 10:20:32 (GMT)
committerGitHub <noreply@github.com>2022-10-05 10:20:32 (GMT)
commit73e3510bdb2762e371e8545f1a4c68b821fcdcf2 (patch)
treebfe899c4a23992853ea13275082d34d81092489b /Modules
parent79b5c1ad3c750312d6af062a70808555b4ea49ab (diff)
downloadcpython-73e3510bdb2762e371e8545f1a4c68b821fcdcf2.zip
cpython-73e3510bdb2762e371e8545f1a4c68b821fcdcf2.tar.gz
cpython-73e3510bdb2762e371e8545f1a4c68b821fcdcf2.tar.bz2
gh-97758: Fix a crash in getpath_joinpath() called without arguments (GH-97759)
(cherry picked from commit f8cbd79d328d90443acabc41d246332c302c815a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Modules')
-rw-r--r--Modules/getpath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/getpath.c b/Modules/getpath.c
index be704ad..ceacf36 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -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 *));