aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan Harris <mail@aidanharris.io>2018-12-22 10:52:27 +0000
committeremersion <contact@emersion.fr>2018-12-22 14:02:29 +0100
commit0d3cf36c854fb6481e09db07e9b52456e34bce84 (patch)
tree2a187266711d10aa38e995d3d0820aa506773a4e
parent88d96bc41ff638bdc767e30bf6ccbbd530258420 (diff)
IPC_SUBSCRIBE ensure request object is an array
Fixes #3320
-rw-r--r--sway/ipc-server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index 2c642a37..69009f25 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -664,7 +664,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
{
// TODO: Check if they're permitted to use these events
struct json_object *request = json_tokener_parse(buf);
- if (request == NULL) {
+ if (request == NULL || !json_object_is_type(request, json_type_array)) {
const char msg[] = "{\"success\": false}";
client_valid = ipc_send_reply(client, msg, strlen(msg));
wlr_log(WLR_INFO, "Failed to parse subscribe request");