mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Validate params before dispatching
This commit is contained in:
@@ -116,6 +116,9 @@ std::string RPCServerHandler::processRequest (std::string const& request, IP::En
|
|||||||
{
|
{
|
||||||
Json::Value ripple_params (params.size()
|
Json::Value ripple_params (params.size()
|
||||||
? params [0u] : Json::Value (Json::objectValue));
|
? params [0u] : Json::Value (Json::objectValue));
|
||||||
|
if (!ripple_params.isObject())
|
||||||
|
return HTTPReply (400, "params must be an object");
|
||||||
|
|
||||||
ripple_params ["command"] = strMethod;
|
ripple_params ["command"] = strMethod;
|
||||||
RPC::Request req (LogPartition::getJournal <RPCServer> (),
|
RPC::Request req (LogPartition::getJournal <RPCServer> (),
|
||||||
strMethod, ripple_params, getApp ());
|
strMethod, ripple_params, getApp ());
|
||||||
|
|||||||
Reference in New Issue
Block a user