dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 26339c8c01d8c826ea92d8f71ce95730264cfe59
parent f8eb276df2f0bc9430337451068bd1dcf2322811
Author: Marc Andre Tanner <mat@brain-dump.org>
Date:   Thu, 26 May 2011 20:20:40 +0200

madtty: fix read/write in already freed memory causing a segfault

We can't reuse madtty_dirty in this case because it uses t->lines
which was previously reallocated but still points to the old
address.

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>

Diffstat:
madtty.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/madtty.c b/madtty.c @@ -1184,7 +1184,8 @@ void madtty_resize(madtty_t *t, int rows, int cols) t->maxcols = cols; t->cols = cols; } else if (t->cols != cols) { - madtty_dirty(t); + for (int row = 0; row < t->rows; row++) + lines[row].dirty = true; t->cols = cols; }