Skip to content

Return success with invalid json #107

@purewell

Description

@purewell

input: 0:2:3
Json::Reader::parse returns true. But accessing member makes assert exception.

json: src/lib_json/json_value.cpp:1176: const Json::Value& Json::Value::operator[](const char*) const: Assertion `type_ == nullValue || type_ == objectValue' failed.

test code:

Json::Value root;
Json::Reader reader;

if ( not reader.parse("0:2:3", root) )
{
    cerr << "failed!" << endl;
    cerr << reader.getFormatedErrorMessages() << endl;
}
else
{
    cerr << "success!" << endl;
}

root.isMember("sss");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions