Restore a check to stop scrolled lines becoming larger than total lines,

fixes a crash reported by Thomas Sattler.
pull/1674/head
nicm 2019-04-01 19:33:38 +00:00
parent d68a17a1df
commit 792fcb1dbf
1 changed files with 2 additions and 0 deletions

2
grid.c
View File

@ -1284,6 +1284,8 @@ grid_reflow(struct grid *gd, u_int sx)
if (target->sy < gd->sy)
grid_reflow_add(target, gd->sy - target->sy);
gd->hsize = target->sy - gd->sy;
if (gd->hscrolled > gd->hsize)
gd->hscrolled = gd->hsize;
free(gd->linedata);
gd->linedata = target->linedata;
free(target);