Bug 865948 - Return the appropriate value when the whitelist checks fail. r=gabor
authorBobby Holley <bobbyholley@gmail.com>
Sat, 27 Apr 2013 16:49:43 -0700
changeset 141132 cf9e342c1e7cd23e184ae0c27f9b5e534f5a62fd
parent 141131 9d3d0552005c2c4a89186d1c89f9d21a2157fea4
child 141133 f6b9554b2b1ca069b17b85e749c84540fdaa8e7e
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgabor
bugs865948
milestone23.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 865948 - Return the appropriate value when the whitelist checks fail. r=gabor
caps/src/nsScriptSecurityManager.cpp
--- a/caps/src/nsScriptSecurityManager.cpp
+++ b/caps/src/nsScriptSecurityManager.cpp
@@ -1278,17 +1278,18 @@ nsScriptSecurityManager::CheckLoadURIWit
                 nsresult rv = CheckLoadURIWithPrincipal((*whiteList)[i],
                                                         aTargetURI,
                                                         aFlags);
                 if (NS_SUCCEEDED(rv)) {
                     // Allow access if it succeeded with one of the white listed principals
                     return NS_OK;
                 }
             }
-            return NS_OK;
+            // None of our whitelisted principals worked.
+            return NS_ERROR_DOM_BAD_URI;
         }
         NS_ERROR("Non-system principals or expanded principal passed to CheckLoadURIWithPrincipal "
                  "must have a URI!");
         return NS_ERROR_UNEXPECTED;
     }
     
     // Automatic loads are not allowed from certain protocols.
     if (aFlags & nsIScriptSecurityManager::LOAD_IS_AUTOMATIC_DOCUMENT_REPLACEMENT) {