Package: tmux / 1.9-6

upstream-315d45a0eb.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
commit 315d45a0eb596048f2513dab98e4bb47ec1852a4
Author: nicm <nicm>
Date:   Sat Feb 22 18:01:10 2014 +0000

    Fix crash due to uninitialized lastwp member of layout_cell, reported by
    Balazs Kezes.

diff --git a/layout.c b/layout.c
index b91b86c..1c76f98 100644
--- a/layout.c
+++ b/layout.c
@@ -53,6 +53,7 @@ layout_create_cell(struct layout_cell *lcparent)
 	lc->yoff = UINT_MAX;
 
 	lc->wp = NULL;
+	lc->lastwp = NULL;
 
 	return (lc);
 }
diff --git a/window.c b/window.c
index 1e11cac..842a5c6 100644
--- a/window.c
+++ b/window.c
@@ -410,8 +410,9 @@ window_pane_active_set(struct window_pane *wp, struct window_pane *nextwp)
 	 * Previously active pane, if any, must not be the same as the source
 	 * pane.
 	 */
-	if (nextwp->layout_cell->parent != NULL) {
-		lastwp = nextwp->layout_cell->parent->lastwp;
+	lc = nextwp->layout_cell->parent;
+	if (lc != NULL && lc->lastwp != NULL) {
+		lastwp = lc->lastwp;
 		if (lastwp != wp && window_pane_visible(lastwp))
 			return (lastwp);
 	}