From 98902abbf6e73734ded5bcccf2866ba8abfc0aa4 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Wed, 6 Oct 2021 17:00:01 +0100 Subject: [PATCH] bpo-45375: Fix off by one error in buffer allocation --- PC/getpathp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PC/getpathp.c b/PC/getpathp.c index 98a754976c6708..062697b3e9afd3 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"); }