Bug 1306300, null check nsILoadContext in GetLoadContextCodebasePrincipal, r=baku
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Thu, 29 Sep 2016 20:31:50 +0300
changeset 315852 14d41b959f3a21fb40c49fa66dc1c7b23642afe8
parent 315851 f451982cae7cd667dea82640196cd6942beef235
child 315853 4cb1b2ae58c0ad71fb41c095b4bf09947da0fb51
push id30757
push usercbook@mozilla.com
push dateFri, 30 Sep 2016 10:02:43 +0000
treeherdermozilla-central@5ffed033557e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1306300
milestone52.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 1306300, null check nsILoadContext in GetLoadContextCodebasePrincipal, r=baku
caps/nsScriptSecurityManager.cpp
--- a/caps/nsScriptSecurityManager.cpp
+++ b/caps/nsScriptSecurityManager.cpp
@@ -1164,16 +1164,17 @@ nsScriptSecurityManager::GetAppCodebaseP
 }
 
 NS_IMETHODIMP
 nsScriptSecurityManager::
   GetLoadContextCodebasePrincipal(nsIURI* aURI,
                                   nsILoadContext* aLoadContext,
                                   nsIPrincipal** aPrincipal)
 {
+  NS_ENSURE_STATE(aLoadContext);
   DocShellOriginAttributes docShellAttrs;
   bool result = aLoadContext->GetOriginAttributes(docShellAttrs);;
   NS_ENSURE_TRUE(result, NS_ERROR_FAILURE);
 
   PrincipalOriginAttributes attrs;
   attrs.InheritFromDocShellToDoc(docShellAttrs, aURI);
 
   nsresult rv = MaybeSetAddonIdFromURI(attrs, aURI);