mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-30 21:50:47 +01:00
#3136: Fixed null character issue when parsing a JSON
This commit is contained in:
@@ -1935,6 +1935,15 @@ void JSONTest::testEscape0()
|
||||
json->stringify(ss);
|
||||
|
||||
assertTrue (ss.str().compare("{\"name\":\"B\\u0000b\"}") == 0);
|
||||
|
||||
// parse the JSON containing the escaped string
|
||||
Poco::JSON::Parser parser(new Poco::JSON::ParseHandler());
|
||||
Var result = parser.parse(ss.str());
|
||||
|
||||
assert(result.type() == typeid(Object::Ptr));
|
||||
|
||||
Object::Ptr object = result.extract<Object::Ptr>();
|
||||
assert(object->get("name").extract<std::string>() == nullString);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user