From 0c70aed39469700f5d9bd0b4ff6a0c1f5b9e68a4 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Jan 14 2014 15:18:38 +0000 Subject: Add overlow detection patch from the upstream (RHBZ# 1011947) - Update all patches. --- diff --git a/rhino-1.7R3-crosslink.patch b/rhino-1.7R3-crosslink.patch index 428632b..c3fe0b5 100644 --- a/rhino-1.7R3-crosslink.patch +++ b/rhino-1.7R3-crosslink.patch @@ -1,7 +1,6 @@ -diff -up rhino1_7R3/build.xml~ rhino1_7R3/build.xml ---- rhino1_7R3/build.xml~ 2011-05-09 20:04:38.000000000 +0300 -+++ rhino1_7R3/build.xml 2011-10-16 00:11:22.625045037 +0300 -@@ -220,6 +220,7 @@ +--- a/build.xml ++++ b/build.xml +@@ -192,6 +192,7 @@ destdir="${dist.dir}/javadoc" version="true" author="true" diff --git a/rhino-addOrbitManifest.patch b/rhino-addOrbitManifest.patch index 0179c29..a9804c4 100644 --- a/rhino-addOrbitManifest.patch +++ b/rhino-addOrbitManifest.patch @@ -1,16 +1,11 @@ -diff -up rhino1_7R3/src/manifest.fixManifest rhino1_7R3/src/manifest ---- rhino1_7R3/src/manifest.fixManifest 2011-05-09 20:04:34.000000000 +0200 -+++ rhino1_7R3/src/manifest 2011-09-14 17:46:28.331978606 +0200 -@@ -1,6 +1,31 @@ - Manifest-Version: 1.0 - Main-Class: org.mozilla.javascript.tools.shell.Main --Implementation-Version: 1.7R4 --Implementation-Title: Mozilla Rhino 1.7R4 -+Implementation-Version: 1.7R4 -+Implementation-Title: Mozilla Rhino 1.7R4 +--- a/src/manifest ++++ b/src/manifest +@@ -3,4 +3,29 @@ Main-Class: org.mozilla.javascript.tools + Implementation-Version: 1.7R4 + Implementation-Title: Mozilla Rhino 1.7R4 Implementation-Vendor: Mozilla Foundation -Implementation-URL: http://www.mozilla.org/rhino -\ Chybí znak konce řádku na konci souboru +\ No newline at end of file +Implementation-URL: http://www.mozilla.org/rhino +Bundle-Vendor: %Bundle-Vendor.0 +Bundle-Localization: plugin diff --git a/rhino-build.patch b/rhino-build.patch index aa1423a..88469a3 100644 --- a/rhino-build.patch +++ b/rhino-build.patch @@ -1,7 +1,6 @@ -diff -up rhino1_7R3/examples/Matrix.java.build rhino1_7R3/examples/Matrix.java ---- rhino1_7R3/examples/Matrix.java.build 2011-05-09 20:04:38.000000000 +0200 -+++ rhino1_7R3/examples/Matrix.java 2011-09-14 17:37:15.167031995 +0200 -@@ -249,7 +249,7 @@ public class Matrix implements Scriptabl +--- a/examples/Matrix.java ++++ b/examples/Matrix.java +@@ -218,7 +218,7 @@ public class Matrix implements Scriptabl * Use the convenience method from Context that takes care of calling * toString, etc. */ @@ -9,11 +8,10 @@ diff -up rhino1_7R3/examples/Matrix.java.build rhino1_7R3/examples/Matrix.java + public Object getDefaultValue(Class typeHint) { return "[object Matrix]"; } - -diff -up rhino1_7R3/examples/PrimitiveWrapFactory.java.build rhino1_7R3/examples/PrimitiveWrapFactory.java ---- rhino1_7R3/examples/PrimitiveWrapFactory.java.build 2011-05-09 20:04:38.000000000 +0200 -+++ rhino1_7R3/examples/PrimitiveWrapFactory.java 2011-09-14 17:37:15.168031994 +0200 -@@ -57,7 +57,7 @@ import org.mozilla.javascript.*; + +--- a/examples/PrimitiveWrapFactory.java ++++ b/examples/PrimitiveWrapFactory.java +@@ -25,7 +25,7 @@ import org.mozilla.javascript.*; public class PrimitiveWrapFactory extends WrapFactory { @Override public Object wrap(Context cx, Scriptable scope, Object obj, @@ -22,10 +20,9 @@ diff -up rhino1_7R3/examples/PrimitiveWrapFactory.java.build rhino1_7R3/examples { if (obj instanceof String || obj instanceof Number || obj instanceof Boolean) -diff -up rhino1_7R3/src/org/mozilla/javascript/WrapFactory.java.build rhino1_7R3/src/org/mozilla/javascript/WrapFactory.java ---- rhino1_7R3/src/org/mozilla/javascript/WrapFactory.java.build 2011-05-09 20:04:34.000000000 +0200 -+++ rhino1_7R3/src/org/mozilla/javascript/WrapFactory.java 2011-09-14 17:37:15.169031993 +0200 -@@ -75,7 +75,7 @@ public class WrapFactory +--- a/src/org/mozilla/javascript/WrapFactory.java ++++ b/src/org/mozilla/javascript/WrapFactory.java +@@ -42,7 +42,7 @@ public class WrapFactory * @return the wrapped value. */ public Object wrap(Context cx, Scriptable scope, @@ -34,19 +31,18 @@ diff -up rhino1_7R3/src/org/mozilla/javascript/WrapFactory.java.build rhino1_7R3 { if (obj == null || obj == Undefined.instance || obj instanceof Scriptable) -diff -up rhino1_7R3/toolsrc/org/mozilla/javascript/tools/debugger/build.xml.build rhino1_7R3/toolsrc/org/mozilla/javascript/tools/debugger/build.xml ---- rhino1_7R3/toolsrc/org/mozilla/javascript/tools/debugger/build.xml.build 2011-05-09 20:04:36.000000000 +0200 -+++ rhino1_7R3/toolsrc/org/mozilla/javascript/tools/debugger/build.xml 2011-09-14 17:37:15.175031989 +0200 -@@ -38,7 +38,7 @@ - +--- a/toolsrc/org/mozilla/javascript/tools/debugger/build.xml ++++ b/toolsrc/org/mozilla/javascript/tools/debugger/build.xml +@@ -8,7 +8,7 @@ + - - -@@ -46,9 +46,9 @@ + +@@ -16,9 +16,9 @@ @@ -59,7 +55,7 @@ diff -up rhino1_7R3/toolsrc/org/mozilla/javascript/tools/debugger/build.xml.buil -@@ -56,58 +56,58 @@ +@@ -26,58 +26,58 @@ @@ -131,53 +127,49 @@ diff -up rhino1_7R3/toolsrc/org/mozilla/javascript/tools/debugger/build.xml.buil - + - + -diff -up rhino1_7R3/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java.build rhino1_7R3/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java ---- rhino1_7R3/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java.build 2011-05-09 20:04:36.000000000 +0200 -+++ rhino1_7R3/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java 2011-09-14 17:37:15.170031993 +0200 -@@ -67,7 +67,7 @@ public class JavaPolicySecurity extends +--- a/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java ++++ b/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java +@@ -36,7 +36,7 @@ public class JavaPolicySecurity extends return super.defineClass(name, data, 0, data.length, domain); } - + - public void linkClass(Class cl) { + public void linkClass(Class cl) { resolveClass(cl); } } -diff -up rhino1_7R3/xmlimplsrc/build.xml.build rhino1_7R3/xmlimplsrc/build.xml -diff -up rhino1_7R3/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java.build rhino1_7R3/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java ---- rhino1_7R3/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java.build 2011-05-09 20:04:38.000000000 +0200 -+++ rhino1_7R3/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java 2011-09-14 17:37:15.171031993 +0200 -@@ -120,7 +120,7 @@ class Namespace extends IdScriptableObje +--- a/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java ++++ b/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java +@@ -86,7 +86,7 @@ class Namespace extends IdScriptableObje } - + @Override - public Object getDefaultValue(Class hint) { + public Object getDefaultValue(Class hint) { return uri(); } - -diff -up rhino1_7R3/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java.build rhino1_7R3/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java ---- rhino1_7R3/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java.build 2011-05-09 20:04:38.000000000 +0200 -+++ rhino1_7R3/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java 2011-09-14 17:37:15.172031992 +0200 -@@ -150,7 +150,7 @@ final class QName extends IdScriptableOb + +--- a/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java ++++ b/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java +@@ -116,7 +116,7 @@ final class QName extends IdScriptableOb } - + @Override - public Object getDefaultValue(Class hint) { + public Object getDefaultValue(Class hint) { return toString(); } - -diff -up rhino1_7R3/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java.build rhino1_7R3/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java ---- rhino1_7R3/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java.build 2011-05-09 20:04:38.000000000 +0200 -+++ rhino1_7R3/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java 2011-09-14 17:37:15.173031991 +0200 -@@ -165,7 +165,7 @@ abstract class XMLObjectImpl extends XML + +--- a/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java ++++ b/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java +@@ -105,7 +105,7 @@ abstract class XMLObjectImpl extends XML } - + @Override - public final Object getDefaultValue(Class hint) { + public final Object getDefaultValue(Class hint) { return this.toString(); } + diff --git a/rhino-overflow-detection.patch b/rhino-overflow-detection.patch new file mode 100644 index 0000000..7ab9d96 --- /dev/null +++ b/rhino-overflow-detection.patch @@ -0,0 +1,41 @@ +From 52e25f784cd1b927d44383aa9afb358191df97e4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Bargull?= +Date: Mon, 30 Jul 2012 18:25:15 +0200 +Subject: [PATCH] Add missing overflow detection when processing RegExp + character class pattern + +--- + src/org/mozilla/javascript/regexp/NativeRegExp.java | 4 +++- + testsrc/doctests/regexp.class-overflow.doctest | 6 ++++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + create mode 100755 testsrc/doctests/regexp.class-overflow.doctest + +--- a/src/org/mozilla/javascript/regexp/NativeRegExp.java ++++ b/src/org/mozilla/javascript/regexp/NativeRegExp.java +@@ -1671,7 +1671,7 @@ public class NativeRegExp extends IdScri + if (inRange) { + if ((gData.regexp.flags & JSREG_FOLD) != 0) { + assert(rangeStart <= thisCh); +- for (c = rangeStart; c <= thisCh; c++) { ++ for (c = rangeStart; c <= thisCh;) { + addCharacterToCharSet(charSet, c); + char uch = upcase(c); + char dch = downcase(c); +@@ -1679,6 +1679,8 @@ public class NativeRegExp extends IdScri + addCharacterToCharSet(charSet, uch); + if (c != dch) + addCharacterToCharSet(charSet, dch); ++ if (++c == 0) ++ break; // overflow + } + } else { + addCharacterRangeToCharSet(charSet, rangeStart, thisCh); +--- /dev/null ++++ b/testsrc/doctests/regexp.class-overflow.doctest +@@ -0,0 +1,6 @@ ++// This Source Code Form is subject to the terms of the Mozilla Public ++// License, v. 2.0. If a copy of the MPL was not distributed with this ++// file, You can obtain one at http://mozilla.org/MPL/2.0/. ++ ++js> /[\u0000-\uFFFF]/i.test(0) ++true diff --git a/rhino-shell-manpage.patch b/rhino-shell-manpage.patch index 5c5e2d8..ed67209 100644 --- a/rhino-shell-manpage.patch +++ b/rhino-shell-manpage.patch @@ -1,5 +1,3 @@ -diff --git a/build.xml b/build.xml -index ae00108..35cbfee 100644 --- a/build.xml +++ b/build.xml @@ -171,6 +171,13 @@ @@ -25,9 +23,6 @@ index ae00108..35cbfee 100644 -diff --git a/man/rhino.1 b/man/rhino.1 -new file mode 100644 -index 0000000..e04a8df --- /dev/null +++ b/man/rhino.1 @@ -0,0 +1,117 @@ diff --git a/rhino.spec b/rhino.spec index 2c84640..1799058 100644 --- a/rhino.spec +++ b/rhino.spec @@ -35,9 +35,9 @@ Name: rhino # of Javascript version 1.7 (which is independent from this particular implementation, # e.g., there is C++ implementation in Spidermonkey) Version: 1.7R4 -Release: 6%{?dist} +Release: 7%{?dist} Summary: JavaScript for Java -License: MPLv2.0 +License: MPLv2.0 Source0: https://github.com/mozilla/rhino/archive/Rhino%{scm_version}_RELEASE.zip Source1: http://repo1.maven.org/maven2/org/mozilla/rhino/%{version}/rhino-%{version}.pom @@ -50,6 +50,10 @@ Patch0: %{name}-build.patch Patch1: %{name}-addOrbitManifest.patch Patch2: %{name}-1.7R3-crosslink.patch Patch3: %{name}-shell-manpage.patch +# Originally from https://github.com/mozilla/rhino/commit\ +# /52e25f784cd1b927d44383aa9afb358191df97e4.patch +# See RHBZ# 1011947 +Patch4: %{name}-overflow-detection.patch URL: http://www.mozilla.org/rhino/ Group: Development/Libraries @@ -99,6 +103,7 @@ Javadoc for %{name}. %patch1 -p1 -b .fixManifest %patch2 -p1 -b .crosslink %patch3 -p1 -b .manpage +%patch4 -p1 -b .overflow # Fix build sed -i -e '/.*$/d' build.xml testsrc/build.xml \ @@ -134,7 +139,7 @@ cp -a build/%{name}%{scm_version}/javadoc/* %{buildroot}%{_javadocdir}/%{name} # man page mkdir -p %{buildroot}%{_mandir}/man1/ install -m 644 build/%{name}%{scm_version}/man/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 - + ## script mkdir -p %{buildroot}%{_bindir} install -m 755 %{SOURCE2} %{buildroot}%{_bindir}/%{name} @@ -169,6 +174,10 @@ install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom %doc %{_javadocdir}/%{name} %changelog +* Tue Jan 14 2014 Matěj Cepl - 1.7R4-7 +- Add overlow detection patch from the upstream (RHBZ# 1011947) +- Update all patches. + * Mon Sep 09 2013 Elliott Baron 1.7R4-6 - Update and add missing options for Rhino shell man page.