mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 14:05:51 +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;
|
||||
|
||||
if (!jvParams.isArray() || jvParams.size() > 1)
|
||||
if (!jvParams.isArray() || jvParams.size() < 1)
|
||||
return rpcError(rpcINVALID_PARAMS);
|
||||
|
||||
Json::Value jvRequest = jvParams[0u];
|
||||
|
||||
if (!jvRequest.isObject() || !jvRequest.isMember("command"))
|
||||
return rpcError(rpcINVALID_PARAMS);
|
||||
|
||||
jvRequest["command"] = strCommand;
|
||||
|
||||
Json::Value jvResult = doCommand(jvRequest, iRole);
|
||||
|
||||
Reference in New Issue
Block a user