hhctrl: Fix NULL pointer dereference in some failure cases.

Tijl Coosemans tijl at ulyssis.org
Mon Apr 28 15:41:47 CDT 2008


---
 dlls/hhctrl.ocx/hhctrl.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
-------------- next part --------------
diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c
index c0054de..9f19004 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 (info)
+        if(!index)
+            index = info->WinType.pszFile;
+
+        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;
     }


More information about the wine-patches mailing list