# HG changeset patch # User Christian Brabandt # Date 1511100905 -3600 # Node ID 1c05b29ab12512d2c658a435bc37264112106f67 # Parent ad5cbf9fba6bd7d3a0195cf2a662141b27432951 patch 8.0.1317: accessing freed memory in term_wait() commit https://github.com/vim/vim/commit/e518226713784e628ae7ee077f1b66cb12b9ffd9 Author: Bram Moolenaar Date: Sun Nov 19 15:05:44 2017 +0100 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. diff --git a/src/terminal.c b/src/terminal.c --- a/src/terminal.c +++ b/src/terminal.c @@ -3227,6 +3227,10 @@ f_term_wait(typval_T *argvars, typval_T { 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(); diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -772,6 +772,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1317, +/**/ 1316, /**/ 1315,