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
index 6cbe343..f1b4313 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -3227,6 +3227,10 @@
{
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
index 99007ac..7e03c4b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -772,6 +772,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1317,
+/**/
1316,
/**/
1315,