From 77efcf8bdd14cd19dc445cf6e44bba7af414939c Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 8 Oct 2014 17:14:04 +0000 Subject: Use xrealloc(NULL, n, m) instead of xmalloc(n * m) to get overflow check. --- grid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'grid.c') diff --git a/grid.c b/grid.c index afb0e041..b2351b28 100644 --- a/grid.c +++ b/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; -- cgit