patch 9.0.1916: Crash when allocating large terminal screen
Problem: Crash when allocating large terminal screen
Solution: Don't allow values > 1000 for terminal
screen columns and rows
closes: #13126
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@ -776,9 +776,15 @@ static int resize(int new_rows, int new_cols, VTermStateFields *fields, void *us
|
||||
if(screen->sb_buffer)
|
||||
vterm_allocator_free(screen->vt, screen->sb_buffer);
|
||||
|
||||
if (new_cols > 1000)
|
||||
new_cols = 1000;
|
||||
|
||||
screen->sb_buffer = vterm_allocator_malloc(screen->vt, sizeof(VTermScreenCell) * new_cols);
|
||||
}
|
||||
|
||||
if (new_rows > 1000)
|
||||
new_rows = 1000;
|
||||
|
||||
resize_buffer(screen, 0, new_rows, new_cols, !altscreen_active, fields);
|
||||
if(screen->buffers[BUFIDX_ALTSCREEN])
|
||||
resize_buffer(screen, 1, new_rows, new_cols, altscreen_active, fields);
|
||||
|
||||
Reference in New Issue
Block a user