Also checks are added to all other paths where info is used.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48510
Signed-off-by: Roman Pišl rpisl@seznam.cz --- dlls/shell32/brsfolder.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c index d71ec62099..f226c97822 100644 --- a/dlls/shell32/brsfolder.c +++ b/dlls/shell32/brsfolder.c @@ -1113,15 +1113,19 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam, switch (msg) { case WM_NOTIFY: + if (!info) return FALSE; return BrsFolder_OnNotify( info, (UINT)wParam, (LPNMHDR)lParam);
case WM_COMMAND: + if (!info) return FALSE; return BrsFolder_OnCommand( info, wParam );
case WM_WINDOWPOSCHANGING: + if (!info) return FALSE; return BrsFolder_OnWindowPosChanging( info, (WINDOWPOS *)lParam);
case WM_SIZE: + if (!info) return FALSE; if (info->layout) /* new style dialogs */ LayoutUpdate(hWnd, info->layout, g_layout_info, ARRAY_SIZE(g_layout_info)); return 0; @@ -1147,18 +1151,23 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam, break;
case BFFM_SETSELECTIONA: + if (!info) return FALSE; return BrsFolder_OnSetSelectionA(info, (LPVOID)lParam, (BOOL)wParam);
case BFFM_SETSELECTIONW: + if (!info) return FALSE; return BrsFolder_OnSetSelectionW(info, (LPVOID)lParam, (BOOL)wParam);
case BFFM_SETEXPANDED: /* unicode only */ + if (!info) return FALSE; return BrsFolder_OnSetExpanded(info, (LPVOID)lParam, (BOOL)wParam, NULL);
case SHV_CHANGE_NOTIFY: + if (!info) return FALSE; return BrsFolder_OnChange(info, (const LPCITEMIDLIST*)wParam, (LONG)lParam);
case WM_DESTROY: + if (!info) return FALSE; return BrsFolder_OnDestroy(info); } return FALSE;
I think it's better to return earlier on null 'info' for all messages, except WM_INITDIALOG obviously, before entering this switch.