Skip to content

Commit

Permalink
patch 8.2.5160: accessing invalid memory after changing terminal size
Browse files Browse the repository at this point in the history
Problem:    Accessing invalid memory after changing terminal size.
Solution:   Adjust cmdline_row and msg_row to the value of Rows.
  • Loading branch information
brammool committed Jun 25, 2022
1 parent e1dc76f commit e178af5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/term.c
Expand Up @@ -3366,6 +3366,12 @@ check_shellsize(void)
if (Rows < min_rows()) // need room for one window and command line
Rows = min_rows();
limit_screen_size();

// make sure these values are not invalid
if (cmdline_row >= Rows)
cmdline_row = Rows - 1;
if (msg_row >= Rows)
msg_row = Rows - 1;
}

/*
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -735,6 +735,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
5160,
/**/
5159,
/**/
Expand Down

0 comments on commit e178af5

Please sign in to comment.