Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Unified Diff: src/json-parser.h

Issue 7569008: Avoid infinite recursion for unterminated non-ASCII JSON string literals. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-91787.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-parser.h
diff --git a/src/json-parser.h b/src/json-parser.h
index f93b04d38ffe520f0a1615b51a9efcf3c5cf21ef..68eab65fd5ab6f094cf2425ee2a95725b52c916c 100644
--- a/src/json-parser.h
+++ b/src/json-parser.h
@@ -458,12 +458,12 @@ Handle<String> JsonParser<seq_ascii>::SlowScanJsonString(
String::WriteToFlat(*prefix, dest, start, end);
while (c0_ != '"') {
+ // Check for control character (0x00-0x1f) or unterminated string (<0).
+ if (c0_ < 0x20) return Handle<String>::null();
if (count >= length) {
// We need to create a longer sequential string for the result.
return SlowScanJsonString<StringType, SinkChar>(seq_str, 0, count);
}
- // Check for control character (0x00-0x1f) or unterminated string (<0).
- if (c0_ < 0x20) return Handle<String>::null();
if (c0_ != '\\') {
// If the sink can contain UC16 characters, or source_ contains only
// ASCII characters, there's no need to test whether we can store the
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-91787.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698