From ee5317f86520392dc8723fd808855930c41f5302 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Tue, 1 Sep 2020 20:56:03 +0200 Subject: json-rpc-test-server: reject non-null params in "ping" --- json-rpc-test-server.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/json-rpc-test-server.c b/json-rpc-test-server.c index 8c51ac4..564c1a7 100644 --- a/json-rpc-test-server.c +++ b/json-rpc-test-server.c @@ -1449,7 +1449,10 @@ static json_t * json_rpc_ping (struct server_context *ctx, json_t *params) { (void) ctx; - (void) params; + + if (params && !json_is_null (params)) + return json_rpc_response (NULL, NULL, + json_rpc_error (JSON_RPC_ERROR_INVALID_PARAMS, NULL)); return json_rpc_response (NULL, json_string ("pong"), NULL); } -- cgit v1.2.3-70-g09d2