Skip to content

Commit e178af5

Browse files
committed
patch 8.2.5160: accessing invalid memory after changing terminal size
Problem: Accessing invalid memory after changing terminal size. Solution: Adjust cmdline_row and msg_row to the value of Rows.
1 parent e1dc76f commit e178af5

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/term.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3366,6 +3366,12 @@ check_shellsize(void)
33663366
if (Rows < min_rows()) // need room for one window and command line
33673367
Rows = min_rows();
33683368
limit_screen_size();
3369+
3370+
// make sure these values are not invalid
3371+
if (cmdline_row >= Rows)
3372+
cmdline_row = Rows - 1;
3373+
if (msg_row >= Rows)
3374+
msg_row = Rows - 1;
33693375
}
33703376

33713377
/*

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,8 @@ static char *(features[]) =
735735

736736
static int included_patches[] =
737737
{ /* Add new patch number below this line */
738+
/**/
739+
5160,
738740
/**/
739741
5159,
740742
/**/

0 commit comments

Comments
 (0)