From f71b465eb7575ae7639fbd03b550208c8f31ce43 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 19 Apr 2017 15:53:11 +0100 Subject: Ensure the language field is present in the JSON --- libsolidity/interface/StandardCompiler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp index bd2e64c6..3cff319f 100644 --- a/libsolidity/interface/StandardCompiler.cpp +++ b/libsolidity/interface/StandardCompiler.cpp @@ -152,6 +152,12 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input) { m_compilerStack.reset(false); + if (!_input.isObject()) + return formatFatalError("JSONError", "Input is not a JSON object."); + + if (_input["language"] != "Solidity") + return formatFatalError("JSONError", "Only \"Solidity\" is supported as a language."); + Json::Value const& sources = _input["sources"]; if (!sources) return formatFatalError("JSONError", "No input sources specified."); -- cgit v1.2.3