diff options
author | 2013-03-25 10:07:40 +0000 | |
---|---|---|
committer | 2013-03-25 10:07:40 +0000 | |
commit | 19488e895cca40b012bda9bf9ddfa5abe1f0a106 (patch) | |
tree | 07c8ebfd48385f61b62f252284a6d4a3559ee5ec /usr.bin/tmux/grid.c | |
parent | Do not leak command in formats, from Romain Francoise. (diff) | |
download | wireguard-openbsd-19488e895cca40b012bda9bf9ddfa5abe1f0a106.tar.xz wireguard-openbsd-19488e895cca40b012bda9bf9ddfa5abe1f0a106.zip |
Allow lastgc to be NULL in grid_string_cells so find-window doesn't
crash, problem reported by eugene everson.
Diffstat (limited to 'usr.bin/tmux/grid.c')
-rw-r--r-- | usr.bin/tmux/grid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/grid.c b/usr.bin/tmux/grid.c index 369beff2646..70ff4b005b3 100644 --- a/usr.bin/tmux/grid.c +++ b/usr.bin/tmux/grid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grid.c,v 1.28 2013/03/25 10:05:35 nicm Exp $ */ +/* $OpenBSD: grid.c,v 1.29 2013/03/25 10:07:40 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -595,7 +595,7 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx, GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx); - if (*lastgc == NULL) { + if (lastgc != NULL && *lastgc == NULL) { memcpy(&lastgc1, &grid_default_cell, sizeof lastgc1); *lastgc = &lastgc1; } |