mirror of
https://github.com/tmate-io/tmate.git
synced 2026-01-23 02:24:06 +00:00
Use xrealloc(NULL, n, m) instead of xmalloc(n * m) to get overflow
check.
This commit is contained in:
parent
6610e89689
commit
77efcf8bdd
2 changed files with 3 additions and 2 deletions
3
grid.c
3
grid.c
|
|
@ -724,7 +724,8 @@ grid_reflow_split(struct grid *dst, u_int *py, struct grid_line *src_gl,
|
|||
to_copy = src_gl->cellsize;
|
||||
|
||||
/* Expand destination line. */
|
||||
dst_gl->celldata = xmalloc(to_copy * sizeof *dst_gl->celldata);
|
||||
dst_gl->celldata = xrealloc(NULL, to_copy,
|
||||
sizeof *dst_gl->celldata);
|
||||
dst_gl->cellsize = to_copy;
|
||||
dst_gl->flags |= GRID_LINE_WRAPPED;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue