mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-28 23:15:52 +00:00
Fix validity checking for RPC commands.
This commit is contained in:
@@ -2230,11 +2230,14 @@ Json::Value RPCHandler::doRpcCommand(const std::string& strCommand, Json::Value&
|
|||||||
{
|
{
|
||||||
// cLog(lsTRACE) << "doRpcCommand:" << strCommand << ":" << jvParams;
|
// cLog(lsTRACE) << "doRpcCommand:" << strCommand << ":" << jvParams;
|
||||||
|
|
||||||
if (!jvParams.isArray() || jvParams.size() > 1)
|
if (!jvParams.isArray() || jvParams.size() < 1)
|
||||||
return rpcError(rpcINVALID_PARAMS);
|
return rpcError(rpcINVALID_PARAMS);
|
||||||
|
|
||||||
Json::Value jvRequest = jvParams[0u];
|
Json::Value jvRequest = jvParams[0u];
|
||||||
|
|
||||||
|
if (!jvRequest.isObject() || !jvRequest.isMember("command"))
|
||||||
|
return rpcError(rpcINVALID_PARAMS);
|
||||||
|
|
||||||
jvRequest["command"] = strCommand;
|
jvRequest["command"] = strCommand;
|
||||||
|
|
||||||
Json::Value jvResult = doCommand(jvRequest, iRole);
|
Json::Value jvResult = doCommand(jvRequest, iRole);
|
||||||
|
|||||||
Reference in New Issue
Block a user