1
0
forked from aniani/vim

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.
This commit is contained in:
Bram Moolenaar
2017-11-19 15:05:44 +01:00
parent 44c2bffde7
commit e518226713
2 changed files with 6 additions and 0 deletions

View File

@@ -3227,6 +3227,10 @@ f_term_wait(typval_T *argvars, typval_T *rettv UNUSED)
{
mch_check_messages();
parse_queued_messages();
if (!buf_valid(buf))
/* If the terminal is closed when the channel is closed the
* buffer disappears. */
break;
ui_delay(10L, FALSE);
}
mch_check_messages();