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

Unified Diff: base/json/json_parser_unittest.cc

Issue 2321683003: In base::JSONParser, check IsValidCharacter before decoding ASCII/UTF-8. (Closed)
Patch Set: Created 4 years, 3 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 | « base/json/json_parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_parser_unittest.cc
diff --git a/base/json/json_parser_unittest.cc b/base/json/json_parser_unittest.cc
index 30255ca46126dd89ad0e8471f67eaa4d26bcf39a..b6da2a4bc6ff15cd428545a4bcab7b7891193c1f 100644
--- a/base/json/json_parser_unittest.cc
+++ b/base/json/json_parser_unittest.cc
@@ -323,5 +323,10 @@ TEST_F(JSONParserTest, DecodeUnicodeNonCharacter) {
EXPECT_FALSE(JSONReader::Read("[\"\\ud83f\\udffe\"]"));
}
+TEST_F(JSONParserTest, DecodeNegativeEscapeSequence) {
+ EXPECT_FALSE(JSONReader::Read("[\"\\x-A\"]"));
+ EXPECT_FALSE(JSONReader::Read("[\"\\u-00A\"]"));
+}
+
} // namespace internal
} // namespace base
« no previous file with comments | « base/json/json_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698