>From 151279bf2980208ff09c554be71d41b2d9dacac5 Mon Sep 17 00:00:00 2001 From: Indrek Altpere Date: Sun, 9 Aug 2015 09:24:04 +0300 Subject: [PATCH] mshtml: Handle nsIDOMWindow_GetFrames returning NULL 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 DISP_E_MEMBERNOTFOUND; + } + nsAString_InitDepend(&name_str, name); nsres = nsIDOMWindowCollection_NamedItem(nsframes, &name_str, &nswindow); nsAString_Finish(&name_str); -- 1.9.1