1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-15 04:28:09 -04:00

Add bounds check to array access in terminfo driver.

this fixes a crash due to illegal memory access that can occur if
something is printed to the screen on the "terminal resized"
handler. It is not clear to me whether this race condition can be
triggered by external incoming messages, but it might be better safe
than sorry.
This commit is contained in:
Ailin Nemui 2014-08-09 11:40:37 +02:00
parent 22d4dc729e
commit 836d386823

View File

@ -293,7 +293,7 @@ void term_window_scroll(TERM_WINDOW *window, int count)
term_move_reset(vcx, vcy);
/* set the newly scrolled area dirty */
for (y = 0; y < window->height; y++)
for (y = 0; (window->y+y) < term_height && y < window->height; y++)
term_lines_empty[window->y+y] = FALSE;
}