Bug 1484373: Follow-up: Fix null deref. r=bustage CLOSED TREE
authorKris Maglione <maglione.k@gmail.com>
Thu, 23 Aug 2018 16:01:25 -0700
changeset 488341 9388b9926bc80f4aad52790da62a910528c58263
parent 488340 4239ad0cf14733e735a63c3e6677e37b41fe914f
child 488342 40ae82f3f8b57aa80f3891d09bc30fd8149af42f
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1484373
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1484373: Follow-up: Fix null deref. r=bustage CLOSED TREE
toolkit/components/extensions/ExtensionPolicyService.cpp
--- a/toolkit/components/extensions/ExtensionPolicyService.cpp
+++ b/toolkit/components/extensions/ExtensionPolicyService.cpp
@@ -536,17 +536,20 @@ ExtensionPolicyService::CheckWindow(nsPI
       CheckContentScripts(aWindow, false);
     }
   }
 }
 
 void
 ExtensionPolicyService::CheckContentScripts(const DocInfo& aDocInfo, bool aIsPreload)
 {
-  nsCOMPtr<nsPIDOMWindowInner> win = aDocInfo.GetWindow()->GetCurrentInnerWindow();
+  nsCOMPtr<nsPIDOMWindowInner> win;
+  if (!aIsPreload) {
+    win = aDocInfo.GetWindow()->GetCurrentInnerWindow();
+  }
 
   for (auto iter = mExtensions.Iter(); !iter.Done(); iter.Next()) {
     if (!win->IsCurrentInnerWindow()) {
       break;
     }
 
     RefPtr<WebExtensionPolicy> policy = iter.Data();