[PATCH] mshtml: Handle nsIDOMWindow_GetFrames returning NULL

Indrek Altpere efbiaiinzinz at hotmail.com
Sun Aug 9 01:48:57 CDT 2015


After viewing Gecko source code, nsIDOMWindow_GetFrames can return NULL when internal property mDocShell is uninitialized.
In Gecko source code thare already exist checks for it, so to avoid crashing, Wine should check for it also.

Fixes bugs https://bugs.winehq.org/show_bug.cgi?id=39028 and https://bugs.winehq.org/show_bug.cgi?id=39029
---
 dlls/mshtml/htmlwindow.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c
index b5b906a..443ff84 100644
--- a/dlls/mshtml/htmlwindow.c
+++ b/dlls/mshtml/htmlwindow.c
@@ -380,6 +380,11 @@ HRESULT get_frame_by_name(HTMLOuterWindow *This, const WCHAR *name, BOOL deep, H
         return E_FAIL;
     }
 
+    if(!nsframes) {
+        WARN("nsIDOMWindow_GetFrames returned NULL nsframes: %p\n", This->nswindow);
+        return E_FAIL;
+    }
+
     nsAString_InitDepend(&name_str, name);
     nsres = nsIDOMWindowCollection_NamedItem(nsframes, &name_str, &nswindow);
     nsAString_Finish(&name_str);
-- 
1.9.1




More information about the wine-patches mailing list