changeset 14850:85ef79b16181 v8.1.0437

patch 8.1.0437: may access freed memory when syntax HL times out commit https://github.com/vim/vim/commit/95892c27b242cdbc78e622c7a861a4e15aec7a30 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 28 22:26:54 2018 +0200 patch 8.1.0437: may access freed memory when syntax HL times out Problem: May access freed memory when syntax HL times out. (Philipp Gesang) Solution: Clear b_sst_first when clearing b_sst_array.
author Christian Brabandt <cb@256bit.org>
date Fri, 28 Sep 2018 22:30:06 +0200
parents c2d0417c7f19
children 99d8e4106d26
files src/syntax.c src/version.c
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1192,6 +1192,7 @@ syn_stack_free_block(synblock_T *block)
 	for (p = block->b_sst_first; p != NULL; p = p->sst_next)
 	    clear_syn_state(p);
 	VIM_CLEAR(block->b_sst_array);
+	block->b_sst_first = NULL;
 	block->b_sst_len = 0;
     }
 }
@@ -1323,9 +1324,6 @@ syn_stack_apply_changes_block(synblock_T
     synstate_T	*p, *prev, *np;
     linenr_T	n;
 
-    if (block->b_sst_array == NULL)	/* nothing to do */
-	return;
-
     prev = NULL;
     for (p = block->b_sst_first; p != NULL; )
     {
@@ -1378,7 +1376,7 @@ syn_stack_cleanup(void)
     int		dist;
     int		retval = FALSE;
 
-    if (syn_block->b_sst_array == NULL || syn_block->b_sst_first == NULL)
+    if (syn_block->b_sst_first == NULL)
 	return retval;
 
     /* Compute normal distance between non-displayed entries. */
--- 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 */
 /**/
+    437,
+/**/
     436,
 /**/
     435,