From 35df580fd7f03e39dfccf3a4ad43f2d9e846e16a Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 21 Apr 2015 15:16:06 +0000 Subject: [PATCH] cmd_mouse_pane can return NULL, check for that. --- usr.bin/tmux/window-copy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index 87bf921aee4..4f304cf0b92 100644 --- a/usr.bin/tmux/window-copy.c +++ b/usr.bin/tmux/window-copy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-copy.c,v 1.128 2015/04/20 15:41:32 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.129 2015/04/21 15:16:06 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -2220,7 +2220,7 @@ window_copy_start_drag(struct client *c, unused struct mouse_event *m) u_int x, y; wp = cmd_mouse_pane(m, NULL, NULL); - if (wp->mode != &window_copy_mode) + if (wp == NULL || wp->mode != &window_copy_mode) return; if (cmd_mouse_at(wp, m, &x, &y, 1) != 0) @@ -2242,7 +2242,7 @@ window_copy_drag_update(unused struct client *c, struct mouse_event *m) u_int x, y, old_cy; wp = cmd_mouse_pane(m, NULL, NULL); - if (wp->mode != &window_copy_mode) + if (wp == NULL || wp->mode != &window_copy_mode) return; data = wp->modedata; @@ -2261,7 +2261,7 @@ window_copy_drag_release(unused struct client *c, struct mouse_event *m) struct window_pane *wp; wp = cmd_mouse_pane(m, NULL, NULL); - if (wp->mode != &window_copy_mode) + if (wp == NULL || wp->mode != &window_copy_mode) return; window_copy_copy_selection(wp, NULL); -- 2.20.1