mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-15 00:07:16 +00:00
shell32: Avoid stack corruption with long name in SHELL_TryAppPathW().
This commit is contained in:
parent
94e3e2d115
commit
f1c57f06d6
|
@ -428,8 +428,14 @@ static BOOL SHELL_TryAppPathW( LPCWSTR szName, LPWSTR lpResult, WCHAR **env)
|
|||
BOOL found = FALSE;
|
||||
|
||||
if (env) *env = NULL;
|
||||
lstrcpyW(buffer, L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\");
|
||||
lstrcatW(buffer, szName);
|
||||
wcscpy(buffer, L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\");
|
||||
if (wcslen(buffer) + wcslen(szName) + 1 > ARRAY_SIZE(buffer))
|
||||
{
|
||||
WARN("Name is too big.\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
wcscat(buffer, szName);
|
||||
res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &hkApp);
|
||||
if (res) goto end;
|
||||
|
||||
|
|
Loading…
Reference in a new issue