Bug 1475235 - Check if the parameters are null in nsGlobalWindowInner::SaveFirstPartyStorageAccessGrantedForOriginOnParentProcess, r=Alex_Gaynor
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 12 Jul 2018 15:23:08 +0200
changeset 426315 8d82ddedfa25f37e77f39989942195c8b308766b
parent 426314 9851707b13cbcc41a970d677eab3a32d320e81dd
child 426316 3db02eb59e35c5a768bf5572b4392a35f5dfc459
push id105200
push useramarchesini@mozilla.com
push dateThu, 12 Jul 2018 13:23:30 +0000
treeherdermozilla-inbound@8d82ddedfa25 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersAlex_Gaynor
bugs1475235
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 1475235 - Check if the parameters are null in nsGlobalWindowInner::SaveFirstPartyStorageAccessGrantedForOriginOnParentProcess, r=Alex_Gaynor
dom/base/nsGlobalWindowInner.cpp
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -8207,17 +8207,21 @@ nsGlobalWindowInner::SaveFirstPartyStora
 }
 
 /* static */ void
 nsGlobalWindowInner::SaveFirstPartyStorageAccessGrantedForOriginOnParentProcess(nsIPrincipal* aPrincipal,
                                                                                 const nsCString& aParentOrigin,
                                                                                 const nsCString& aGrantedOrigin)
 {
   MOZ_ASSERT(XRE_IsParentProcess());
-  MOZ_ASSERT(aPrincipal);
+
+  if (NS_WARN_IF(!aPrincipal)) {
+    // The child process is sending something wrong. Let's ignore it.
+    return;
+  }
 
   nsAutoCString origin;
   nsresult rv = aPrincipal->GetOriginNoSuffix(origin);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
 
   nsCOMPtr<nsIPermissionManager> pm = services::GetPermissionManager();