mirror of
https://github.com/monero-project/monero.git
synced 2024-10-01 11:49:47 -04:00
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)
|
FullMessage::FullMessage(const std::string& json_string, bool request)
|
||||||
{
|
{
|
||||||
doc.Parse(json_string.c_str());
|
doc.Parse(json_string.c_str());
|
||||||
if (doc.HasParseError())
|
if (doc.HasParseError() || !doc.IsObject())
|
||||||
{
|
{
|
||||||
throw cryptonote::json::PARSE_FAIL();
|
throw cryptonote::json::PARSE_FAIL();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user