Assertion with invalid JSON string
Bug #1331904 reported by
Michi Henning
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libjsoncpp (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
The following code parses the JSON string successfully, but then asserts where indicated:
Json::Value root;
Json::Reader reader;
std::string s = R"(
"a": "b"
)";
if (!reader.parse(s, root))
abort();
std::cerr << "parse OK" << std::endl;
auto a = root["a"]; // Asserts at json_value.cpp:1136
The output is:
parse OK
src/lib_
parse() should report that the parse failed, but doesn't.
To post a comment you must log in.