From 6c942a86a4fb4c8b731cb1bd2933dba554eb79cd Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Wed, 6 Oct 2021 20:09:33 +0100 Subject: bpo-45375: Fix off by one error in buffer allocation (GH-28764) --- PC/getpathp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PC/getpathp.c b/PC/getpathp.c index 98a7549..062697b 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"); } -- cgit v0.12