fixed licenses
authorRiccardo Pelizzi <r.pelizzi@gmail.com>
Mon, 19 Dec 2011 14:37:54 +0100
changeset 31 3ad78df80cd545306f34d4c67af108d99b51d1aa
parent 30 630d17b1bdee9a8a69cae444e190ea9a15b4aa1f
child 32 9b64b998e2c70cbb6394e8e88fd3b9b251e7e357
push id19
push userr.pelizzi@gmail.com
push dateMon, 19 Dec 2011 22:20:17 +0000
fixed licenses
xssfilter
--- a/xssfilter
+++ b/xssfilter
@@ -347,45 +347,46 @@ diff --git a/caps/src/nsPrincipal.cpp b/
  
    // If there is a certificate, it takes precendence over the codebase.
    if (mCert) {
      *aValue = nsCRT::HashCode(mCert->fingerprint.get());
    }
 diff --git a/caps/src/nsScriptSecurityManager.cpp b/caps/src/nsScriptSecurityManager.cpp
 --- a/caps/src/nsScriptSecurityManager.cpp
 +++ b/caps/src/nsScriptSecurityManager.cpp
-@@ -85,20 +85,27 @@
+@@ -85,20 +85,28 @@
  #include "nsDOMJSUtils.h"
  #include "nsAboutProtocolUtils.h"
  #include "nsIClassInfo.h"
  #include "nsIURIFixup.h"
  #include "nsCDefaultURIFixup.h"
  #include "nsIChromeRegistry.h"
  #include "nsIContentSecurityPolicy.h"
  #include "nsIAsyncVerifyRedirectCallback.h"
 +#include "nsXSSFilter.h"
 +#include "jspubtd.h"
 +#include "prlog.h"
  #include "mozilla/Preferences.h"
++#include "nsJSUtils.h"
  
  using namespace mozilla;
  
 +#ifdef PR_LOGGING
 +static PRLogModuleInfo *gXssPRLog = PR_NewLogModule("XSS");
 +#endif
 +
  static NS_DEFINE_CID(kZipReaderCID, NS_ZIPREADER_CID);
  
  nsIIOService    *nsScriptSecurityManager::sIOService = nsnull;
  nsIXPConnect    *nsScriptSecurityManager::sXPConnect = nsnull;
  nsIThreadJSContextStack *nsScriptSecurityManager::sJSContextStack = nsnull;
  nsIStringBundle *nsScriptSecurityManager::sStrBundle = nsnull;
  JSRuntime       *nsScriptSecurityManager::sRuntime   = 0;
  bool nsScriptSecurityManager::sStrictFileOriginPolicy = true;
-@@ -584,16 +591,64 @@ nsScriptSecurityManager::ContentSecurity
+@@ -584,16 +592,64 @@ nsScriptSecurityManager::ContentSecurity
                                   fileName,
                                   scriptSample,
                                   lineNum);
      }
  
      return evalOK;
  }
  
@@ -422,35 +423,35 @@ diff --git a/caps/src/nsScriptSecurityMa
 +    // don't do anything unless there's a filter
 +    if (!xss)
 +        return JS_TRUE;
 +
 +    if (str == NULL) {
 +        NS_WARNING("XSS: str is null");
 +        return JS_TRUE;
 +    }
-+    size_t len = 0;
-+    const jschar *jschrs = JS_GetStringCharsAndLength(cx, str, &len);
-+    if (jschrs == NULL) {
++
++    nsDependentJSString nsStr;
++    if (!nsStr.init(cx, str)) {
++        NS_WARNING("Failed to get nsDependentJSString");
 +        return JS_TRUE;
 +    }
-+    nsAutoString nsStr(jschrs);
 +
 +    return xss->PermitsJSAction(nsStr, action) ? JS_TRUE : JS_FALSE;
 +}
 +
  
  JSBool
  nsScriptSecurityManager::CheckObjectAccess(JSContext *cx, JSObject *obj,
                                             jsid id, JSAccessMode mode,
                                             jsval *vp)
  {
      // Get the security manager
      nsScriptSecurityManager *ssm =
-@@ -3390,17 +3445,18 @@ nsresult nsScriptSecurityManager::Init()
+@@ -3390,17 +3446,18 @@ nsresult nsScriptSecurityManager::Init()
  
      rv = runtimeService->GetRuntime(&sRuntime);
      NS_ENSURE_SUCCESS(rv, rv);
  
      static JSSecurityCallbacks securityCallbacks = {
          CheckObjectAccess,
          NULL,
          NULL,
@@ -553,17 +554,17 @@ new file mode 100644
 + * http://www.mozilla.org/MPL/
 + *
 + * Software distributed under the License is distributed on an "AS IS" basis,
 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 + * for the specific language governing rights and limitations under the
 + * License.
 + *
 + * The Initial Developer of the Original Code is
-+ * Mozilla Corporation
++ * the Mozilla Foundation
 + *
 + * Contributor(s):
 + *  Riccardo Pelizzi <r.pelizzi@gmail.com>
 + *
 + * Alternatively, the contents of this file may be used under the terms of
 + * either the GNU General Public License Version 2 or later (the "GPL"), or
 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 + * in which case the provisions of the GPL or the LGPL are applicable instead
@@ -1040,18 +1041,18 @@ new file mode 100644
 + * Software distributed under the License is distributed on an "AS IS" basis,
 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 + * for the specific language governing rights and limitations under the
 + * License.
 + *
 + * The Original Code is mozilla.org code.
 + *
 + * The Initial Developer of the Original Code is
-+ * Mozilla Corporation.
-+ * Portions created by the Initial Developer are Copyright (C) 2009
++ * the Mozilla Foundation.
++ * Portions created by the Initial Developer are Copyright (C) 2011
 + * the Initial Developer. All Rights Reserved.
 + *
 + * Contributor(s):
 + *   Riccardo Pelizzi <r.pelizzi@gmail.com>
 + *
 + * Alternatively, the contents of this file may be used under the terms of
 + * either of the GNU General Public License Version 2 or later (the "GPL"),
 + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
@@ -1571,17 +1572,17 @@ new file mode 100644
 + * Software distributed under the License is distributed on an "AS IS" basis,
 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 + * for the specific language governing rights and limitations under the
 + * License.
 + *
 + * The Original Code is mozilla.org code.
 + *
 + * The Initial Developer of the Original Code is
-+ * Mozilla Corporation.
++ * the Mozilla Foundation.
 + * Portions created by the Initial Developer are Copyright (C) 2011
 + * the Initial Developer. All Rights Reserved.
 + *
 + * Contributor(s):
 + *   Riccardo Pelizzi <r.pelizzi@gmail.com>
 + *
 + * Alternatively, the contents of this file may be used under the terms of
 + * either of the GNU General Public License Version 2 or later (the "GPL"),
@@ -1814,17 +1815,17 @@ new file mode 100644
 + * Software distributed under the License is distributed on an "AS IS" basis,
 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 + * for the specific language governing rights and limitations under the
 + * License.
 + *
 + * The Original Code is mozilla.org code.
 + *
 + * The Initial Developer of the Original Code is
-+ * Mozilla Corporation.
++ * the Mozilla Foundation.
 + * Portions created by the Initial Developer are Copyright (C) 2011
 + * the Initial Developer. All Rights Reserved.
 + *
 + * Contributor(s):
 + *   Riccardo Pelizzi <r.pelizzi@gmail.com>
 + *
 + * Alternatively, the contents of this file may be used under the terms of
 + * either of the GNU General Public License Version 2 or later (the "GPL"),
@@ -3417,18 +3418,18 @@ new file mode 100644
 + * Software distributed under the License is distributed on an "AS IS" basis,
 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 + * for the specific language governing rights and limitations under the
 + * License.
 + *
 + * The Original Code is mozilla.org code.
 + *
 + * The Initial Developer of the Original Code is
-+ * Mozilla Corporation.
-+ * Portions created by the Initial Developer are Copyright (C) 2009
++ * Mozilla Foundation
++ * Portions created by the Initial Developer are Copyright (C) 2011
 + * the Initial Developer. All Rights Reserved.
 + *
 + * Contributor(s):
 + *   Riccardo Pelizzi <r.pelizzi@gmail.com>
 + *
 + * Alternatively, the contents of this file may be used under the terms of
 + * either of the GNU General Public License Version 2 or later (the "GPL"),
 + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
@@ -3713,17 +3714,17 @@ new file mode 100644
 + *
 + * Software distributed under the License is distributed on an "AS IS" basis,
 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 + * for the specific language governing rights and limitations under the
 + * License.
 + *
 + * The Initial Developer of the Original Code is
 + * The Mozilla Foundation <http://www.mozilla.org/>.
-+ * Portions created by the Initial Developer are Copyright (C) 2009
++ * Portions created by the Initial Developer are Copyright (C) 2011
 + * the Initial Developer. All Rights Reserved.
 + *
 + * Contributor(s):
 + *  Riccardo Pelizzi <r.pelizzi@gmail.com>
 + *
 + * Alternatively, the contents of this file may be used under the terms of
 + * either the GNU General Public License Version 2 or later (the "GPL"), or
 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
@@ -3845,18 +3846,18 @@ new file mode 100644
 + * Software distributed under the License is distributed on an "AS IS" basis,
 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 + * for the specific language governing rights and limitations under the
 + * License.
 + *
 + * The Original Code is mozilla.org code.
 + *
 + * The Initial Developer of the Original Code is
-+ * Mozilla Corporation.
-+ * Portions created by the Initial Developer are Copyright (C) 2009
++ * the Mozilla Foundation.
++ * Portions created by the Initial Developer are Copyright (C) 2011
 + * the Initial Developer. All Rights Reserved.
 + *
 + * Contributor(s):
 + *   Riccardo Pelizzi <r.pelizzi@gmail.com>
 + *
 + * Alternatively, the contents of this file may be used under the terms of
 + * either of the GNU General Public License Version 2 or later (the "GPL"),
 + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),