From 0aad594d5f0d032f88ca174aa2ae56f8493b40df Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Sun, 16 Oct 2011 14:49:14 -0700 Subject: [PATCH] shell32: Use existing buffer rather than copying, and potentially truncating, a filename prior to executing it. --- dlls/shell32/shlexec.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index b25a04b413c..7fd485e5944 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -1797,6 +1797,7 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) /* terminate previous command string after the quote character */ *end = '\0'; + lpFile = wfileName; } else { @@ -1827,12 +1828,10 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc ) } } - lstrcpynW(wfileName, sei_tmp.lpFile,sizeof(wfileName)/sizeof(WCHAR)); + lpFile = sei_tmp.lpFile; } } else - lstrcpynW(wfileName, sei_tmp.lpFile,sizeof(wfileName)/sizeof(WCHAR)); - - lpFile = wfileName; + lpFile = sei_tmp.lpFile; wcmd = wcmdBuffer; len = lstrlenW(wszApplicationName) + 1;