Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r230026 - appendQuotedJSONString stops on arithmetic overflow i…
…nstead of propagating it upwards https://bugs.webkit.org/show_bug.cgi?id=183894 Reviewed by Saam Barati. JSTests: * stress/json-stringified-overflow.js: Added. (catch): Source/JavaScriptCore: Use the return value of appendQuotedJSONString to fail more gracefully when given a string that is too large to handle. * runtime/JSONObject.cpp: (JSC::Stringifier::appendStringifiedValue): Source/WTF: appendQuotedJSONString now returns a bool indicating whether it succeeded, instead of silently failing when given a string too large to fit in 4GB. * wtf/text/StringBuilder.h: * wtf/text/StringBuilderJSON.cpp: (WTF::StringBuilder::appendQuotedJSONString):
- Loading branch information
1 parent
dc2aa21
commit d043f0e
Showing
7 changed files
with
51 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
try { | ||
JSON.stringify("123".padStart(1073741823)) | ||
} catch (e) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters