mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 04:34:48 +00:00
shell32: Make sure wcmd has enough space to hold the string.
If the length of wszApplicationName exceeds 1024, it will cause an error when writing to the subsequent stack space after exceeding the wcmd space, Wcmd needs to be modified to dynamic allocation. Signed-off-by: Jiajin Cui <cuijiajin@uniontech.com>
This commit is contained in:
parent
41cc117b3f
commit
eee640c938
|
@ -1764,6 +1764,14 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
|
||||||
TRACE("execute:%s,%s,%s\n", debugstr_w(wszApplicationName), debugstr_w(wszParameters), debugstr_w(wszDir));
|
TRACE("execute:%s,%s,%s\n", debugstr_w(wszApplicationName), debugstr_w(wszParameters), debugstr_w(wszDir));
|
||||||
lpFile = sei_tmp.lpFile;
|
lpFile = sei_tmp.lpFile;
|
||||||
wcmd = wcmdBuffer;
|
wcmd = wcmdBuffer;
|
||||||
|
len = lstrlenW(wszApplicationName) + 3;
|
||||||
|
if (sei_tmp.lpParameters[0])
|
||||||
|
len += 1 + lstrlenW(wszParameters);
|
||||||
|
if (len > wcmdLen)
|
||||||
|
{
|
||||||
|
wcmd = heap_alloc(len * sizeof(WCHAR));
|
||||||
|
wcmdLen = len;
|
||||||
|
}
|
||||||
lstrcpyW(wcmd, wszApplicationName);
|
lstrcpyW(wcmd, wszApplicationName);
|
||||||
if (sei_tmp.lpDirectory)
|
if (sei_tmp.lpDirectory)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue