Thomas Adam
2015-04-28 15:58:51 UTC
When checking a client's tty path, don't segfault if it's NULL.
---
cmd-find.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/cmd-find.c b/cmd-find.c
index fab3849..3ac9936 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -243,6 +243,8 @@ cmd_find_current_session_with_client(struct cmd_find_state *fs)
/* If this is running in a pane, that's great. */
RB_FOREACH(wp, window_pane_tree, &all_window_panes) {
+ if (fs->cmdq->client->tty.path == NULL)
+ continue;
if (strcmp(wp->tty, fs->cmdq->client->tty.path) == 0)
break;
}
---
cmd-find.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/cmd-find.c b/cmd-find.c
index fab3849..3ac9936 100644
--- a/cmd-find.c
+++ b/cmd-find.c
@@ -243,6 +243,8 @@ cmd_find_current_session_with_client(struct cmd_find_state *fs)
/* If this is running in a pane, that's great. */
RB_FOREACH(wp, window_pane_tree, &all_window_panes) {
+ if (fs->cmdq->client->tty.path == NULL)
+ continue;
if (strcmp(wp->tty, fs->cmdq->client->tty.path) == 0)
break;
}
--
2.1.4
2.1.4