comdlg32: Prevent SEGV in FILEOPEN95_OnOpen when a malformed filter is passed.

FILEOPEN95_OnOpen assumes that each item in the filter list returns a
non-NULL pointer for CB_GETITEMDATA.
This commit is contained in:
Troy Rollo 2006-05-30 16:54:03 +10:00 committed by Alexandre Julliard
parent 93fd4c12f8
commit f1bd9ae2da
1 changed files with 3 additions and 2 deletions

View File

@ -2370,8 +2370,6 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd)
CBAddStringW(fodInfos->DlgInfos.hwndFileTypeCB, lpstrDisplay);
nFilters++;
/* malformed filters are added anyway... */
if (!*lpstrPos) break;
/* Copy the extensions */
if (!(lpstrExt = MemAlloc((strlenW(lpstrPos)+1)*sizeof(WCHAR)))) return E_FAIL;
@ -2380,6 +2378,9 @@ static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd)
/* Add the item at the end of the combo */
CBSetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, nFilters-1, lpstrExt);
/* malformed filters are added anyway... */
if (!*lpstrExt) break;
}
}