From 315d45a0eb596048f2513dab98e4bb47ec1852a4 Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 22 Feb 2014 18:01:10 +0000 Subject: Fix crash due to uninitialized lastwp member of layout_cell, reported by Balazs Kezes. --- window.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'window.c') diff --git a/window.c b/window.c index 1e11cace..842a5c63 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); } -- cgit