]> granicus.if.org Git - python/commitdiff
Issue #25846: Fix usage of Py_ARRAY_LENGTH() in win32_wchdir() (new try)
authorVictor Stinner <victor.stinner@gmail.com>
Sun, 13 Dec 2015 23:21:50 +0000 (00:21 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Sun, 13 Dec 2015 23:21:50 +0000 (00:21 +0100)
Modules/posixmodule.c

index c25d535b804acc100301eab514cee742b719e74c..e4b27a79c0e4adac34e0f97d9e4e497cacedd8c4 100644 (file)
@@ -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);