]> granicus.if.org Git - vim/commitdiff
patch 8.1.0358: crash when using term_dumpwrite() after the job finished v8.1.0358
authorBram Moolenaar <Bram@vim.org>
Sun, 9 Sep 2018 17:56:07 +0000 (19:56 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 9 Sep 2018 17:56:07 +0000 (19:56 +0200)
Problem:    Crash when using term_dumpwrite() after the job finished.
Solution:   Check for a finished job and give an error message.

src/terminal.c
src/version.c

index 8524560a4d1edad7606ca73fa0623ee1f443de4e..0c7630c62087f6a454d6987526088f1706176211 100644 (file)
@@ -3871,6 +3871,11 @@ f_term_dumpwrite(typval_T *argvars, typval_T *rettv UNUSED)
     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)
     {
index a594aa2aea0501317abd2f15427d5a855f1e0e7e..67bfbd164499a6aefbb927ab615178b49c9702bc 100644 (file)
@@ -794,6 +794,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    358,
 /**/
     357,
 /**/