From: Victor Stinner Date: Sun, 13 Dec 2015 23:21:50 +0000 (+0100) Subject: Issue #25846: Fix usage of Py_ARRAY_LENGTH() in win32_wchdir() (new try) X-Git-Tag: v3.6.0a1~915^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e847d7170d3f41b1ec773ab203c11f1addd6d4ac;p=thirdparty%2FPython%2Fcpython.git Issue #25846: Fix usage of Py_ARRAY_LENGTH() in win32_wchdir() (new try) --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index c25d535b804a..e4b27a79c0e4 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1354,7 +1354,7 @@ win32_wchdir(LPCWSTR path) result = GetCurrentDirectoryW(Py_ARRAY_LENGTH(path_buf), new_path); if (!result) return FALSE; - if (result > Py_ARRAY_LENGTH(new_path)) { + if (result > Py_ARRAY_LENGTH(path_buf)) { new_path = PyMem_RawMalloc(result * sizeof(wchar_t)); if (!new_path) { SetLastError(ERROR_OUTOFMEMORY);