Skip to content

Commit e518226

Browse files
committed
patch 8.0.1317: accessing freed memory in term_wait()
Problem: Accessing freed memory in term_wait(). (Dominique Pelle) Solution: Check that the buffer still exists.
1 parent 44c2bff commit e518226

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/terminal.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3227,6 +3227,10 @@ f_term_wait(typval_T *argvars, typval_T *rettv UNUSED)
32273227
{
32283228
mch_check_messages();
32293229
parse_queued_messages();
3230+
if (!buf_valid(buf))
3231+
/* If the terminal is closed when the channel is closed the
3232+
* buffer disappears. */
3233+
break;
32303234
ui_delay(10L, FALSE);
32313235
}
32323236
mch_check_messages();

src/version.c

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

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1317,
774776
/**/
775777
1316,
776778
/**/

0 commit comments

Comments
 (0)