summaryrefslogtreecommitdiff
path: root/modules/rpc/jsonrpc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/rpc/jsonrpc.cpp')
-rw-r--r--modules/rpc/jsonrpc.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/rpc/jsonrpc.cpp b/modules/rpc/jsonrpc.cpp
index fc4c40e83..1e7315984 100644
--- a/modules/rpc/jsonrpc.cpp
+++ b/modules/rpc/jsonrpc.cpp
@@ -150,7 +150,16 @@ public:
return true;
}
- if (!event->second->Run(this, client, request))
+ auto *eh = event->second;
+ if (request.data.size() < eh->GetMinParams())
+ {
+ auto error = Anope::printf("Not enough parameters (given %zu, expected %zu)",
+ request.data.size(), eh->GetMinParams());
+ SendError(reply, RPC::ERR_INVALID_PARAMS, error, id);
+ return true;
+ }
+
+ if (!eh->Run(this, client, request))
return false;
this->Reply(request);