[PATCH 1/1] pane_current_command: fix segfault

9 views
Skip to first unread message

Thomas Adam

unread,
Oct 8, 2019, 11:55:54 AM10/8/19
to tmux-...@googlegroups.com, Thomas Adam
When trying to call splitw from a zoomed pane due to running
'choose-tree', tmux will segfault as the default format will try and
access wp->shell which isn't initialised.

Skip this in the format's current_command callback as we can't do
anything useful with it anyway.
---
format.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/format.c b/format.c
index 27c27d68..8bc4215c 100644
--- a/format.c
+++ b/format.c
@@ -574,7 +574,7 @@ format_cb_current_command(struct format_tree *ft, struct format_entry *fe)
struct window_pane *wp = ft->wp;
char *cmd;

- if (wp == NULL)
+ if (wp == NULL || wp->shell == NULL)
return;

cmd = osdep_get_name(wp->fd, wp->tty);
--
2.22.0

Reply all
Reply to author
Forward
0 new messages