rpc: guard against json parsing a non object
This commit is contained in:
parent
c2ed8618e4
commit
b4524892fb
@ -111,7 +111,7 @@ FullMessage::FullMessage(Message* message)
|
||||
FullMessage::FullMessage(const std::string& json_string, bool request)
|
||||
{
|
||||
doc.Parse(json_string.c_str());
|
||||
if (doc.HasParseError())
|
||||
if (doc.HasParseError() || !doc.IsObject())
|
||||
{
|
||||
throw cryptonote::json::PARSE_FAIL();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user