Commit f1bd9ae2 authored by Troy Rollo's avatar Troy Rollo Committed by Alexandre Julliard

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.
parent 93fd4c12
......@@ -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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment