shell32: Provide helper function a buffer of correct size
André Hentschel
nerv at dawncrow.de
Wed Mar 23 14:25:12 CDT 2016
Signed-off-by: André Hentschel <nerv at dawncrow.de>
---
dlls/shell32/shlexec.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 5fcbe03..6aa3eec 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -1087,6 +1087,7 @@ HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpR
{
UINT_PTR retval = SE_ERR_NOASSOC;
WCHAR old_dir[1024];
+ WCHAR res[MAX_PATH];
TRACE("File %s, Dir %s\n", debugstr_w(lpFile), debugstr_w(lpDirectory));
@@ -1100,7 +1101,10 @@ HINSTANCE WINAPI FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpR
SetCurrentDirectoryW(lpDirectory);
}
- retval = SHELL_FindExecutable(lpDirectory, lpFile, wszOpen, lpResult, MAX_PATH, NULL, NULL, NULL, NULL);
+ retval = SHELL_FindExecutable(lpDirectory, lpFile, wszOpen, res, MAX_PATH, NULL, NULL, NULL, NULL);
+
+ if (retval > 32)
+ strcpyW(lpResult, res);
TRACE("returning %s\n", debugstr_w(lpResult));
if (lpDirectory)
--
1.9.1
More information about the wine-patches
mailing list