From: Indrek Altpere Subject: [PATCH] mshtml: Handle nsIDOMWindow_GetFrames returning NULL Message-Id: <1439102937-21076-1-git-send-email-efbiaiinzinz@hotmail.com> Date: Sun, 9 Aug 2015 09:48:57 +0300 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