mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 07:30:56 +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;
|
BOOL found = FALSE;
|
||||||
|
|
||||||
if (env) *env = NULL;
|
if (env) *env = NULL;
|
||||||
lstrcpyW(buffer, L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\");
|
wcscpy(buffer, L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\");
|
||||||
lstrcatW(buffer, szName);
|
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);
|
res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, buffer, 0, KEY_READ, &hkApp);
|
||||||
if (res) goto end;
|
if (res) goto end;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue