module/i3: log errors when IPC replies/events are missing data

This commit is contained in:
Daniel Eklöf 2020-01-24 18:44:51 +01:00
parent f4e456a0ad
commit 1d24755f6b
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 21 additions and 5 deletions

View file

@ -204,6 +204,8 @@ i3_receive_loop(int abort_fd, int sock,
break;
}
LOG_DBG("header: type=%x", hdr->type);
/* Json-c expects a NULL-terminated string */
char json_str[hdr->size + 1];
memcpy(json_str, &buf[sizeof(*hdr)], hdr->size);
@ -219,7 +221,6 @@ i3_receive_loop(int abort_fd, int sock,
break;
}
//err = pkt_handler(hdr, json, data);
i3_ipc_callback_t pkt_handler = NULL;
switch (hdr->type) {
case I3_IPC_REPLY_TYPE_COMMAND: