Module: wine Branch: master Commit: 436e96c5cb2887af239e1131f81d7cf002c1ac02 URL: https://gitlab.winehq.org/wine/wine/-/commit/436e96c5cb2887af239e1131f81d7cf...
Author: Yuxuan Shui yshui@codeweavers.com Date: Mon May 20 09:00:30 2024 +0100
shell32: Make sure array passed to PathResolve is big enough.
---
dlls/shell32/shlexec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index d2fe3caed88..f0cf27c5098 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -599,7 +599,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, WCHAR wBuffer[256]; /* Used to GetProfileString */ UINT retval = SE_ERR_NOASSOC; WCHAR *tok; /* token pointer */ - WCHAR xlpFile[256]; /* result of SearchPath */ + WCHAR xlpFile[MAX_PATH]; /* result of SearchPath */ DWORD attribs; /* file attributes */ WCHAR curdir[MAX_PATH]; const WCHAR *search_paths[3] = {0}; @@ -634,7 +634,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb, } else search_paths[0] = curdir; - GetCurrentDirectoryW(MAX_PATH, curdir); + GetCurrentDirectoryW(ARRAY_SIZE(curdir), curdir); lstrcpyW(xlpFile, lpFile); if (PathResolveAW(xlpFile, (const void **)search_paths, PRF_TRYPROGRAMEXTENSIONS | PRF_VERIFYEXISTS)) {