shell32: Fixed potential buffer overwrite in execute_from_key (Coverity).

Marcus Meissner <marcus at jet.franken.de>

svn path=/trunk/; revision=39402
This commit is contained in:
Christoph von Wittich 2009-02-05 08:55:28 +00:00
parent 63e35e6ed4
commit ff0436a020

View file

@ -908,6 +908,8 @@ static UINT_PTR execute_from_key(LPWSTR key, LPCWSTR lpFile, WCHAR *env, LPCWSTR
/* Is there a replace() function anywhere? */
cmdlen /= sizeof(WCHAR);
if (cmdlen >= sizeof(cmd)/sizeof(WCHAR))
cmdlen = sizeof(cmd)/sizeof(WCHAR)-1;
cmd[cmdlen] = '\0';
SHELL_ArgifyW(param, sizeof(param)/sizeof(WCHAR), cmd, lpFile, psei->lpIDList, szCommandline, &resultLen);
if (resultLen > sizeof(param)/sizeof(WCHAR))