aboutsummaryrefslogtreecommitdiffstats
path: root/sway/ipc-server.c
diff options
context:
space:
mode:
authorLibravatar Aidan Harris <mail@aidanharris.io>2018-12-22 10:52:27 +0000
committerLibravatar emersion <contact@emersion.fr>2018-12-22 14:02:29 +0100
commit0d3cf36c854fb6481e09db07e9b52456e34bce84 (patch)
tree2a187266711d10aa38e995d3d0820aa506773a4e /sway/ipc-server.c
parentCombine output_by_name and output_by_identifier (diff)
downloadsway-0d3cf36c854fb6481e09db07e9b52456e34bce84.tar.gz
sway-0d3cf36c854fb6481e09db07e9b52456e34bce84.tar.zst
sway-0d3cf36c854fb6481e09db07e9b52456e34bce84.zip
IPC_SUBSCRIBE ensure request object is an array
Fixes #3320
Diffstat (limited to 'sway/ipc-server.c')
-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) {
664 { 664 {
665 // TODO: Check if they're permitted to use these events 665 // TODO: Check if they're permitted to use these events
666 struct json_object *request = json_tokener_parse(buf); 666 struct json_object *request = json_tokener_parse(buf);
667 if (request == NULL) { 667 if (request == NULL || !json_object_is_type(request, json_type_array)) {
668 const char msg[] = "{\"success\": false}"; 668 const char msg[] = "{\"success\": false}";
669 client_valid = ipc_send_reply(client, msg, strlen(msg)); 669 client_valid = ipc_send_reply(client, msg, strlen(msg));
670 wlr_log(WLR_INFO, "Failed to parse subscribe request"); 670 wlr_log(WLR_INFO, "Failed to parse subscribe request");