mirror of
https://github.com/tmate-io/tmate.git
synced 2026-01-23 02:24:06 +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
1 changed files with 2 additions and 1 deletions
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);
|
||||
memcpy(dstl->celldata, srcl->celldata,
|
||||
srcl->cellsize * sizeof *dstl->celldata);
|
||||
}
|
||||
} else
|
||||
dstl->celldata = NULL;
|
||||
|
||||
sy++;
|
||||
dy++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue