mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Do not crash on invalid JSON input
This commit is contained in:
parent
6202664d70
commit
2f66c69bd1
@ -181,6 +181,10 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
|||||||
for (auto const& sourceName: sources.getMemberNames())
|
for (auto const& sourceName: sources.getMemberNames())
|
||||||
{
|
{
|
||||||
string hash;
|
string hash;
|
||||||
|
|
||||||
|
if (!sources[sourceName].isObject())
|
||||||
|
return formatFatalError("JSONError", "Source input is not a JSON object.");
|
||||||
|
|
||||||
if (sources[sourceName]["keccak256"].isString())
|
if (sources[sourceName]["keccak256"].isString())
|
||||||
hash = sources[sourceName]["keccak256"].asString();
|
hash = sources[sourceName]["keccak256"].asString();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user