changeset 14691:e2497d9c51c4 v8.1.0358

patch 8.1.0358: crash when using term_dumpwrite() after the job finished commit https://github.com/vim/vim/commit/a5c48c2698291e59244a705af1b7dbc60e03b09c Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 9 19:56:07 2018 +0200 patch 8.1.0358: crash when using term_dumpwrite() after the job finished Problem: Crash when using term_dumpwrite() after the job finished. Solution: Check for a finished job and give an error message.
author Christian Brabandt <cb@256bit.org>
date Sun, 09 Sep 2018 20:00:07 +0200
parents 0dea97ff819e
children e77ffc311025
files src/terminal.c src/version.c
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -3871,6 +3871,11 @@ f_term_dumpwrite(typval_T *argvars, typv
     if (buf == NULL)
 	return;
     term = buf->b_term;
+    if (term->tl_vterm == NULL)
+    {
+	EMSG(_("E958: Job already finished"));
+	return;
+    }
 
     if (argvars[2].v_type != VAR_UNKNOWN)
     {
--- a/src/version.c
+++ b/src/version.c
@@ -795,6 +795,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    358,
+/**/
     357,
 /**/
     356,