]> granicus.if.org Git - vim/commitdiff
patch 8.2.3803: GUI: crash with 'writedelay' set using a terminal window v8.2.3803
authorBram Moolenaar <Bram@vim.org>
Tue, 14 Dec 2021 08:41:38 +0000 (08:41 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 14 Dec 2021 08:41:38 +0000 (08:41 +0000)
Problem:    Crash when 'writedelay' is set and using a terminal window to
            execute a shell command.
Solution:   Check that "tl_vterm" isn't NULL. (closes #9346)

src/terminal.c
src/version.c

index f8dc219b41faca4327026e9e8a89a933bab1b8ea..7efe071eb538c80064a1e293df0a805e180ac4ae 100644 (file)
@@ -2101,15 +2101,15 @@ term_enter_job_mode()
 /*
  * Get a key from the user with terminal mode mappings.
  * Note: while waiting a terminal may be closed and freed if the channel is
- * closed and ++close was used.
+ * closed and ++close was used.  This may even happen before we get here.
  */
     static int
 term_vgetc()
 {
     int c;
     int save_State = State;
-    int modify_other_keys =
-                         vterm_is_modify_other_keys(curbuf->b_term->tl_vterm);
+    int modify_other_keys = curbuf->b_term->tl_vterm == NULL ? FALSE
+                       : vterm_is_modify_other_keys(curbuf->b_term->tl_vterm);
 
     State = TERMINAL;
     got_int = FALSE;
index 4181019c1381c8421bb2659ba802213bc9848d49..7af95778c3c45c707f88925dee0ff38efadad05c 100644 (file)
@@ -749,6 +749,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3803,
 /**/
     3802,
 /**/