From e6b4160be15d8a0f541b598280d1bb2f1d07a06c Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 20 Apr 2015 11:16:55 -0400 Subject: [PATCH] Fix a potential null-deref in TabChild::HandlePossibleViewportChange. (bug 1156156, r=kats) --HG-- extra : rebase_source : 8dd897458121121c77442901fb728a53fc912ef8 --- dom/ipc/TabChild.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 97a09a06287b..461a1de6a072 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -275,6 +275,9 @@ TabChildBase::HandlePossibleViewportChange(const ScreenIntSize& aOldScreenSize) Stringify(aOldScreenSize).c_str(), Stringify(mInnerSize).c_str()); nsCOMPtr document(GetDocument()); + if (!document) { + return false; + } nsViewportInfo viewportInfo = nsContentUtils::GetViewportInfo(document, mInnerSize); uint32_t presShellId = 0;