Tijl Coosemans : hhctrl: Fix NULL pointer dereference in some failure cases .
Module: wine Branch: master Commit: efa040119ba2a636c654e69b5caed1829b5c0968 URL: http://source.winehq.org/git/wine.git/?a=commit;h=efa040119ba2a636c654e69b5c... Author: Tijl Coosemans <tijl(a)ulyssis.org> Date: Mon Apr 28 22:41:47 2008 +0200 hhctrl: Fix NULL pointer dereference in some failure cases. --- dlls/hhctrl.ocx/hhctrl.c | 15 +++++++++------ 1 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c index e663c11..a555a42 100644 --- a/dlls/hhctrl.ocx/hhctrl.c +++ b/dlls/hhctrl.ocx/hhctrl.c @@ -123,14 +123,17 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat } info = CreateHelpViewer(filename); + if(!info) + return NULL; + + if(!index) + index = info->WinType.pszFile; - if (info) + res = NavigateToChm(info, info->pCHMInfo->szFile, index); + if(!res) { - if (!index) - index = info->WinType.pszFile; - res = NavigateToChm(info, info->pCHMInfo->szFile, index); - if(!res) - ReleaseHelpViewer(info); + ReleaseHelpViewer(info); + return NULL; } return info->WinType.hwndHelp; }
participants (1)
-
Alexandre Julliard