diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 845ecd85c0..36348fa544 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -54,3 +54,6 @@ leetal Benjamin Lee (mobileben) René Meusel (reneme) + +Sony Corporation +Gareth Sylvester-Bradley (garethsb-sony) diff --git a/Release/src/json/json_parsing.cpp b/Release/src/json/json_parsing.cpp index 2af0ed1629..30873fd36d 100644 --- a/Release/src/json/json_parsing.cpp +++ b/Release/src/json/json_parsing.cpp @@ -965,7 +965,7 @@ std::unique_ptr JSON_Parser::_ParseObject( if (tkn.m_error) goto error; // State 2: Looking for a colon. - if (tkn.kind != JSON_Parser::Token::TKN_Colon) goto done; + if (tkn.kind != JSON_Parser::Token::TKN_Colon) goto error; GetNextToken(tkn); if (tkn.m_error) goto error; diff --git a/Release/tests/functional/json/parsing_tests.cpp b/Release/tests/functional/json/parsing_tests.cpp index fc7a23779c..cf5a261bf0 100644 --- a/Release/tests/functional/json/parsing_tests.cpp +++ b/Release/tests/functional/json/parsing_tests.cpp @@ -469,6 +469,12 @@ SUITE(parsing_tests) VERIFY_ARE_EQUAL(0u, arr.size()); } + TEST(bug_object_field_key_no_value) + { + VERIFY_PARSING_THROW(json::value::parse(U("{\"meow\"}"))); + VERIFY_PARSING_THROW(json::value::parse(U("{\"meow\": 42, \"purr\": 57, \"hiss\"}"))); + } + TEST(bug_416116) { json::value data2 = json::value::parse(U("\"δοκιμή\""));