Title: [251403] trunk
Revision
251403
Author
[email protected]
Date
2019-10-21 17:51:26 -0700 (Mon, 21 Oct 2019)

Log Message

Fix missing exception check in JSON Stringifier.
https://bugs.webkit.org/show_bug.cgi?id=203227
<rdar://problem/56459854>

Reviewed by Keith Miller.

JSTests:

* stress/missing-exception-check-in-josn-stringifier.js: Added.

Source/_javascript_Core:

* runtime/JSONObject.cpp:
(JSC::Stringifier::Stringifier):

Modified Paths

Added Paths

Diff

Modified: trunk/JSTests/ChangeLog (251402 => 251403)


--- trunk/JSTests/ChangeLog	2019-10-22 00:43:07 UTC (rev 251402)
+++ trunk/JSTests/ChangeLog	2019-10-22 00:51:26 UTC (rev 251403)
@@ -1,3 +1,13 @@
+2019-10-21  Mark Lam  <[email protected]>
+
+        Fix missing exception check in JSON Stringifier.
+        https://bugs.webkit.org/show_bug.cgi?id=203227
+        <rdar://problem/56459854>
+
+        Reviewed by Keith Miller.
+
+        * stress/missing-exception-check-in-josn-stringifier.js: Added.
+
 2019-10-21  Saam Barati  <[email protected]>
 
         JSON.parse has bad is array assert

Added: trunk/JSTests/stress/missing-exception-check-in-josn-stringifier.js (0 => 251403)


--- trunk/JSTests/stress/missing-exception-check-in-josn-stringifier.js	                        (rev 0)
+++ trunk/JSTests/stress/missing-exception-check-in-josn-stringifier.js	2019-10-22 00:51:26 UTC (rev 251403)
@@ -0,0 +1,8 @@
+//@ runDefault
+
+let p = new Proxy([], {
+    get: function() {
+        return {};
+    }
+});
+JSON.stringify(null, p);

Modified: trunk/Source/_javascript_Core/ChangeLog (251402 => 251403)


--- trunk/Source/_javascript_Core/ChangeLog	2019-10-22 00:43:07 UTC (rev 251402)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-10-22 00:51:26 UTC (rev 251403)
@@ -1,5 +1,16 @@
 2019-10-21  Mark Lam  <[email protected]>
 
+        Fix missing exception check in JSON Stringifier.
+        https://bugs.webkit.org/show_bug.cgi?id=203227
+        <rdar://problem/56459854>
+
+        Reviewed by Keith Miller.
+
+        * runtime/JSONObject.cpp:
+        (JSC::Stringifier::Stringifier):
+
+2019-10-21  Mark Lam  <[email protected]>
+
         Rolling out r251226: Causes a build speed regression.
         https://bugs.webkit.org/show_bug.cgi?id=203219
 

Modified: trunk/Source/_javascript_Core/runtime/JSONObject.cpp (251402 => 251403)


--- trunk/Source/_javascript_Core/runtime/JSONObject.cpp	2019-10-22 00:43:07 UTC (rev 251402)
+++ trunk/Source/_javascript_Core/runtime/JSONObject.cpp	2019-10-22 00:51:26 UTC (rev 251403)
@@ -237,8 +237,10 @@
             RETURN_IF_EXCEPTION(scope, );
             if (isArrayReplacer) {
                 m_usingArrayReplacer = true;
-                unsigned length = replacerObject->get(exec, vm.propertyNames->length).toUInt32(exec);
+                JSValue lengthValue = replacerObject->get(exec, vm.propertyNames->length);
                 RETURN_IF_EXCEPTION(scope, );
+                unsigned length = lengthValue.toUInt32(exec);
+                RETURN_IF_EXCEPTION(scope, );
                 for (unsigned i = 0; i < length; ++i) {
                     JSValue name = replacerObject->get(exec, i);
                     RETURN_IF_EXCEPTION(scope, );
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to