diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2020-09-01 20:56:03 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2020-09-01 20:56:03 +0200 |
commit | ee5317f86520392dc8723fd808855930c41f5302 (patch) | |
tree | fe61f3a73e90fb4f30e882181d4013581c37da56 | |
parent | 20558ecd2b0b9e0d5a7878e4eaba8cc2dfde2f1b (diff) | |
download | json-rpc-shell-ee5317f86520392dc8723fd808855930c41f5302.tar.gz json-rpc-shell-ee5317f86520392dc8723fd808855930c41f5302.tar.xz json-rpc-shell-ee5317f86520392dc8723fd808855930c41f5302.zip |
json-rpc-test-server: reject non-null params in "ping"
-rw-r--r-- | json-rpc-test-server.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); } |