mirror of
https://github.com/tmux/tmux.git
synced 2025-01-15 05:09:04 +00:00
In grid_duplicate_lines, if the line is empty (cellsize == 0) then clear
the destination celldata pointer rather than leaving a stale copy of the source pointer (which may later be freed). Fixes a crash found by Kuang-che Wu.
This commit is contained in:
parent
58b659a26e
commit
3219e0314e
3
grid.c
3
grid.c
@ -652,7 +652,8 @@ grid_duplicate_lines(struct grid *dst, u_int dy, struct grid *src, u_int sy,
|
|||||||
srcl->cellsize, sizeof *dstl->celldata);
|
srcl->cellsize, sizeof *dstl->celldata);
|
||||||
memcpy(dstl->celldata, srcl->celldata,
|
memcpy(dstl->celldata, srcl->celldata,
|
||||||
srcl->cellsize * sizeof *dstl->celldata);
|
srcl->cellsize * sizeof *dstl->celldata);
|
||||||
}
|
} else
|
||||||
|
dstl->celldata = NULL;
|
||||||
|
|
||||||
sy++;
|
sy++;
|
||||||
dy++;
|
dy++;
|
||||||
|
Loading…
Reference in New Issue
Block a user