diff options
author | nicm <nicm> | 2022-05-30 13:03:46 +0000 |
---|---|---|
committer | nicm <nicm> | 2022-05-30 13:03:46 +0000 |
commit | af1496b300cd755dcffd514ed0a329943f633cd4 (patch) | |
tree | a6cf9807c00113dde5fa56f79d448e4bcafccae4 | |
parent | 2b60ff588ebc26258848fa9d89a6e32e46eeba58 (diff) | |
download | rtmux-af1496b300cd755dcffd514ed0a329943f633cd4.tar.gz rtmux-af1496b300cd755dcffd514ed0a329943f633cd4.tar.bz2 rtmux-af1496b300cd755dcffd514ed0a329943f633cd4.zip |
Do not allow pipe-pane on dead panes, from Anindya Mukherjee, GitHub
issue 3174.
-rw-r--r-- | cmd-pipe-pane.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd-pipe-pane.c b/cmd-pipe-pane.c index 1a8c851b..bedc8f24 100644 --- a/cmd-pipe-pane.c +++ b/cmd-pipe-pane.c @@ -68,6 +68,12 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmdq_item *item) struct format_tree *ft; sigset_t set, oldset; + /* Do nothing if pane is dead. */ + if (wp->fd == -1 || (wp->flags & PANE_EXITED)) { + cmdq_error(item, "target pane has exited"); + return (CMD_RETURN_ERROR); + } + /* Destroy the old pipe. */ old_fd = wp->pipe_fd; if (wp->pipe_fd != -1) { |