Thomas Adam
unread,May 6, 2020, 7:35:09 PM5/6/20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to tmux-...@googlegroups.com, Thomas Adam
The client can be NULL, so don't try and access c->name before we've
checked if the client is not NULL.
---
cmd-queue.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cmd-queue.c b/cmd-queue.c
index 077599fb..26e2f2f9 100644
--- a/cmd-queue.c
+++ b/cmd-queue.c
@@ -540,11 +540,12 @@ cmdq_add_message(struct cmdq_item *item)
{
struct client *c = item->client;
struct cmdq_state *state = item->state;
- const char *name = c->name, *key;
+ const char *name, *key;
char *tmp;
tmp = cmd_print(item->cmd);
if (c != NULL) {
+ name = c->name;
if (c->session != NULL && state->event.key != KEYC_NONE) {
key = key_string_lookup_key(state->event.key);
server_add_message("%s key %s: %s", name, key, tmp);
--
2.26.1