wordpad: Avoid an out-of-bounds array access in registry_set_filelist.

This commit is contained in:
Gerald Pfeifer 2014-12-27 09:57:41 +01:00 committed by Alexandre Julliard
parent d28c40da3b
commit c7482ad1c1
1 changed files with 1 additions and 1 deletions

View File

@ -318,7 +318,7 @@ void registry_set_filelist(LPCWSTR newFile, HWND hMainWnd)
pFiles[0] = newFile;
}
for(i = 0; pFiles[i] && i < FILELIST_ENTRIES; i++)
for(i = 0; i < FILELIST_ENTRIES && pFiles[i]; i++)
{
wsprintfW(buffer, var_file, i+1);
RegSetValueExW(hKey, (LPWSTR)&buffer, 0, REG_SZ, (const BYTE*)pFiles[i],