Title: [249020] trunk
Revision
249020
Author
[email protected]
Date
2019-08-22 11:18:04 -0700 (Thu, 22 Aug 2019)

Log Message

Add missing exception check in canonicalizeLocaleList
https://bugs.webkit.org/show_bug.cgi?id=201021

Reviewed by Mark Lam.

JSTests:

* stress/missing-exception-check-in-canonicalizeLocaleList.js: Added.
(catch):

Source/_javascript_Core:

* runtime/IntlObject.cpp:
(JSC::canonicalizeLocaleList):

Modified Paths

Added Paths

Diff

Modified: trunk/JSTests/ChangeLog (249019 => 249020)


--- trunk/JSTests/ChangeLog	2019-08-22 18:13:08 UTC (rev 249019)
+++ trunk/JSTests/ChangeLog	2019-08-22 18:18:04 UTC (rev 249020)
@@ -1,3 +1,13 @@
+2019-08-22  Justin Michaud  <[email protected]>
+
+        Add missing exception check in canonicalizeLocaleList
+        https://bugs.webkit.org/show_bug.cgi?id=201021
+
+        Reviewed by Mark Lam.
+
+        * stress/missing-exception-check-in-canonicalizeLocaleList.js: Added.
+        (catch):
+
 2019-08-21  Mark Lam  <[email protected]>
 
         Wasm::FunctionParser is failing to enforce maxFunctionLocals.

Added: trunk/JSTests/stress/missing-exception-check-in-canonicalizeLocaleList.js (0 => 249020)


--- trunk/JSTests/stress/missing-exception-check-in-canonicalizeLocaleList.js	                        (rev 0)
+++ trunk/JSTests/stress/missing-exception-check-in-canonicalizeLocaleList.js	2019-08-22 18:18:04 UTC (rev 249020)
@@ -0,0 +1,20 @@
+try {
+const s1 = (-1).toLocaleString().padEnd(2**31-1, 'aa');
+'a'.toLocaleLowerCase(s1);
+} catch (e) { exception = e }
+if (exception != "Error: Out of memory")
+    throw "FAILED";
+
+try {
+const s1 = (-1).toLocaleString().padEnd(2**31-1, 'aa');
+'a'.toLocaleUpperCase(s1);
+} catch (e) { exception2 = e }
+if (exception2 != "Error: Out of memory")
+    throw "FAILED";
+
+try {
+const s1 = (-1).toLocaleString().padEnd(2**31-1, 'aa');
+'a'.localeCompare('b', s1);
+} catch (e) { exception3 = e }
+if (exception3 != "Error: Out of memory")
+    throw "FAILED";

Modified: trunk/Source/_javascript_Core/ChangeLog (249019 => 249020)


--- trunk/Source/_javascript_Core/ChangeLog	2019-08-22 18:13:08 UTC (rev 249019)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-08-22 18:18:04 UTC (rev 249020)
@@ -1,3 +1,13 @@
+2019-08-22  Justin Michaud  <[email protected]>
+
+        Add missing exception check in canonicalizeLocaleList
+        https://bugs.webkit.org/show_bug.cgi?id=201021
+
+        Reviewed by Mark Lam.
+
+        * runtime/IntlObject.cpp:
+        (JSC::canonicalizeLocaleList):
+
 2019-08-17  Darin Adler  <[email protected]>
 
         Use makeString and multi-argument StringBuilder::append instead of less efficient multiple appends

Modified: trunk/Source/_javascript_Core/runtime/IntlObject.cpp (249019 => 249020)


--- trunk/Source/_javascript_Core/runtime/IntlObject.cpp	2019-08-22 18:13:08 UTC (rev 249019)
+++ trunk/Source/_javascript_Core/runtime/IntlObject.cpp	2019-08-22 18:18:04 UTC (rev 249020)
@@ -549,9 +549,12 @@
             JSString* tag = kValue.toString(&state);
             RETURN_IF_EXCEPTION(scope, Vector<String>());
 
-            String canonicalizedTag = canonicalizeLanguageTag(tag->value(&state));
+            auto tagValue = tag->value(&state);
+            RETURN_IF_EXCEPTION(scope, Vector<String>());
+
+            String canonicalizedTag = canonicalizeLanguageTag(tagValue);
             if (canonicalizedTag.isNull()) {
-                throwException(&state, scope, createRangeError(&state, "invalid language tag: " + tag->value(&state)));
+                throwException(&state, scope, createRangeError(&state, "invalid language tag: " + tagValue));
                 return Vector<String>();
             }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to