]> granicus.if.org Git - vim/commitdiff
patch 8.0.0859: NULL pointer access when term_free_vterm called twice v8.0.0859
authorBram Moolenaar <Bram@vim.org>
Fri, 4 Aug 2017 18:29:53 +0000 (20:29 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 4 Aug 2017 18:29:53 +0000 (20:29 +0200)
Problem:    NULL pointer access when term_free_vterm called twice.
Solution:   Return when tl_vterm is NULL. (Yasuhiro Matsumoto, closes #1934)

src/terminal.c
src/version.c

index a4120b39c63f150e69eda3be8abada7eb08ed3f9..893cd0f1b84439e57a3388d109f5e7f8a664cdb4 100644 (file)
@@ -691,8 +691,11 @@ move_terminal_to_buffer(term_T *term)
     VTermPos       pos;
     VTermScreenCell cell;
     VTermScreenCell *p;
-    VTermScreen            *screen = vterm_obtain_screen(term->tl_vterm);
+    VTermScreen            *screen;
 
+    if (term->tl_vterm == NULL)
+       return;
+    screen = vterm_obtain_screen(term->tl_vterm);
     for (pos.row = 0; pos.row < term->tl_rows; ++pos.row)
     {
        len = 0;
index e50eeaf637a61226b013504c44fd54a337f5ce25..a5e02a1a7c56e0f4a4bb3c6e276e62055496bfa8 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    859,
 /**/
     858,
 /**/