Skip to content

Commit 6c942a8

Browse files
authored
bpo-45375: Fix off by one error in buffer allocation (GH-28764)
1 parent 8e8f752 commit 6c942a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

PC/getpathp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ canonicalize(wchar_t *buffer, const wchar_t *path)
266266
}
267267

268268
if (PathIsRelativeW(path)) {
269-
wchar_t buff[MAXPATHLEN];
269+
wchar_t buff[MAXPATHLEN + 1];
270270
if (!GetCurrentDirectoryW(MAXPATHLEN, buff)) {
271271
return _PyStatus_ERR("unable to find current working directory");
272272
}

0 commit comments

Comments
 (0)