Bug 605760 - Deal with null a subject principal here. r=jst
authorBlake Kaplan <mrbkap@gmail.com>
Wed, 10 Nov 2010 14:08:11 -0800
changeset 57304 69d43cbd595a380de906ee6baaeb54b9e0f09978
parent 57303 4563259585a26d9061d7745a33ef81b4d5fe48c5
child 57305 43e0c9f82545fa3c53dd26e3b1dfc6c1d4f8ad76
push id16862
push usermrbkap@mozilla.com
push dateWed, 10 Nov 2010 23:58:05 +0000
treeherdermozilla-central@43e0c9f82545 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst
bugs605760
milestone2.0b8pre
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 605760 - Deal with null a subject principal here. r=jst
js/src/xpconnect/wrappers/AccessCheck.cpp
--- a/js/src/xpconnect/wrappers/AccessCheck.cpp
+++ b/js/src/xpconnect/wrappers/AccessCheck.cpp
@@ -242,16 +242,19 @@ AccessCheck::documentDomainMakesSameOrig
         JSAutoEnterCompartment ac;
 
         if (!ac.enter(cx, scope))
             return false;
 
         subject = GetPrincipal(JS_GetGlobalForObject(cx, scope));
     }
 
+    if (!subject)
+        return false;
+
     {
         JSAutoEnterCompartment ac;
 
         if (!ac.enter(cx, obj))
             return false;
 
         object = GetPrincipal(JS_GetGlobalForObject(cx, obj));
     }