When dealing with switching to the last session, ensure we pre-initialise
the session (s) to NULL, otherwise random address values can be used in the
case where there's no session, leading to a segfault.

This was seen on Linux; I couldn't reproduce this at home on OpenBSD.  But
this behaviour was broken recently with the switch-client changes.
---
 cmd-switch-client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd-switch-client.c b/cmd-switch-client.c
index 3d97c5b..d8f7346 100644
--- a/cmd-switch-client.c
+++ b/cmd-switch-client.c
@@ -61,7 +61,7 @@ cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
 {
        struct args             *args = self->args;
        struct client           *c;
-       struct session          *s;
+       struct session          *s = NULL;
        struct winlink          *wl = NULL;
        struct window           *w = NULL;
        struct window_pane      *wp = NULL;
-- 
1.8.4.rc2


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to