]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45375: Fix off by one error in buffer allocation (GH-28764)
authorSteve Dower <steve.dower@python.org>
Wed, 6 Oct 2021 19:09:33 +0000 (20:09 +0100)
committerGitHub <noreply@github.com>
Wed, 6 Oct 2021 19:09:33 +0000 (20:09 +0100)
PC/getpathp.c

index 98a754976c670866f1a3c4d437bc789d1f632bda..062697b3e9afd3e7ac8007fa1dbc90ffaff862fa 100644 (file)
@@ -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");
         }