diff options
Diffstat (limited to 'base/json_reader_unittest.cc')
-rw-r--r-- | base/json_reader_unittest.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/base/json_reader_unittest.cc b/base/json_reader_unittest.cc index 6c60a07..c2d6a42 100644 --- a/base/json_reader_unittest.cc +++ b/base/json_reader_unittest.cc @@ -481,6 +481,13 @@ TEST(JSONReaderTest, Reading) { ASSERT_EQ(L"\x7f51\x9875", str_val); delete root; + // Test invalid utf8 encoded input + root = NULL; + ASSERT_FALSE(JSONReader::JsonToValue("\"345\xb0\xa1\xb0\xa2\"", &root, + false, false)); + ASSERT_FALSE(JSONReader::JsonToValue("\"123\xc0\x81\"", &root, + false, false)); + // Test invalid root objects. root = NULL; ASSERT_FALSE(JSONReader::Read("null", &root, false)); |