changeset 11958:052270a67371

patch 8.0.0859: NULL pointer access when term_free_vterm called twice commit https://github.com/vim/vim/commit/8e5eece8c5f22a2235edeb743d06253f6c54cfdc Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 4 20:29:53 2017 +0200 patch 8.0.0859: NULL pointer access when term_free_vterm called twice Problem: NULL pointer access when term_free_vterm called twice. Solution: Return when tl_vterm is NULL. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/1934)
author Christian Brabandt <cb@256bit.org>
date Fri, 04 Aug 2017 20:30:04 +0200
parents bc0fee081e1e
children 91a26b7a4119
files src/terminal.c src/version.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -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;
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    859,
+/**/
     858,
 /**/
     857,