diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2022-05-02 10:46:11 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2022-05-02 10:47:08 +0100 |
commit | 3b7dae9a5339c4495d30a4c1bb28ffe8aead0b27 (patch) | |
tree | 71544b9cc90942ab11ef523de80b857d309ab9a6 | |
parent | 5ed64657d82ef9fe8bd2df4383e8accdaf7b1174 (diff) | |
download | rtmux-3b7dae9a5339c4495d30a4c1bb28ffe8aead0b27.tar.gz rtmux-3b7dae9a5339c4495d30a4c1bb28ffe8aead0b27.tar.bz2 rtmux-3b7dae9a5339c4495d30a4c1bb28ffe8aead0b27.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 aac23a0f..0fa656ce 100644 --- a/cmd-pipe-pane.c +++ b/cmd-pipe-pane.c @@ -67,6 +67,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) { |