From: Steve Dower Date: Wed, 6 Oct 2021 19:09:33 +0000 (+0100) Subject: bpo-45375: Fix off by one error in buffer allocation (GH-28764) X-Git-Tag: v3.11.0a2~290 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6c942a86a4fb4c8b731cb1bd2933dba554eb79cd;p=thirdparty%2FPython%2Fcpython.git bpo-45375: Fix off by one error in buffer allocation (GH-28764) --- diff --git a/PC/getpathp.c b/PC/getpathp.c index 98a754976c67..062697b3e9af 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -266,7 +266,7 @@ canonicalize(wchar_t *buffer, const wchar_t *path) } if (PathIsRelativeW(path)) { - wchar_t buff[MAXPATHLEN]; + wchar_t buff[MAXPATHLEN + 1]; if (!GetCurrentDirectoryW(MAXPATHLEN, buff)) { return _PyStatus_ERR("unable to find current working directory"); }