mirror of
https://github.com/tmux/tmux.git
synced 2026-03-06 07:45:35 +00:00
grid_peek_cell can return NULL, so check for it. From Conor Taylor in
GitHub issue 4848.
This commit is contained in:
6
grid.c
6
grid.c
@@ -1089,12 +1089,16 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx,
|
||||
off = 0;
|
||||
|
||||
gl = grid_peek_line(gd, py);
|
||||
if (gl == NULL) {
|
||||
buf[0] = '\0';
|
||||
return (buf);
|
||||
}
|
||||
if (flags & GRID_STRING_EMPTY_CELLS)
|
||||
end = gl->cellsize;
|
||||
else
|
||||
end = gl->cellused;
|
||||
for (xx = px; xx < px + nx; xx++) {
|
||||
if (gl == NULL || xx >= end)
|
||||
if (xx >= end)
|
||||
break;
|
||||
grid_get_cell(gd, xx, py, &gc);
|
||||
if (gc.flags & GRID_FLAG_PADDING)
|
||||
|
||||
Reference in New Issue
Block a user