tmux: tc can be NULL, so check before deref to avoid crashing the server

ok nicm
This commit is contained in:
tb
2026-03-04 07:17:01 +00:00
parent 49bb43047d
commit bcbad050d4

View File

@@ -168,7 +168,7 @@ cmd_send_keys_exec(struct cmd *self, struct cmdq_item *item)
u_int count = args_count(args);
char *cause = NULL;
if (tc->flags & CLIENT_READONLY && !args_has(args, 'X')) {
if (tc != NULL && tc->flags & CLIENT_READONLY && !args_has(args, 'X')) {
cmdq_error(item, "client is read-only");
return (CMD_RETURN_ERROR);
}