mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
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.
This commit is contained in:
@@ -1192,6 +1192,7 @@ syn_stack_free_block(synblock_T *block)
|
|||||||
for (p = block->b_sst_first; p != NULL; p = p->sst_next)
|
for (p = block->b_sst_first; p != NULL; p = p->sst_next)
|
||||||
clear_syn_state(p);
|
clear_syn_state(p);
|
||||||
VIM_CLEAR(block->b_sst_array);
|
VIM_CLEAR(block->b_sst_array);
|
||||||
|
block->b_sst_first = NULL;
|
||||||
block->b_sst_len = 0;
|
block->b_sst_len = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1323,9 +1324,6 @@ syn_stack_apply_changes_block(synblock_T *block, buf_T *buf)
|
|||||||
synstate_T *p, *prev, *np;
|
synstate_T *p, *prev, *np;
|
||||||
linenr_T n;
|
linenr_T n;
|
||||||
|
|
||||||
if (block->b_sst_array == NULL) /* nothing to do */
|
|
||||||
return;
|
|
||||||
|
|
||||||
prev = NULL;
|
prev = NULL;
|
||||||
for (p = block->b_sst_first; p != NULL; )
|
for (p = block->b_sst_first; p != NULL; )
|
||||||
{
|
{
|
||||||
@@ -1378,7 +1376,7 @@ syn_stack_cleanup(void)
|
|||||||
int dist;
|
int dist;
|
||||||
int retval = FALSE;
|
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;
|
return retval;
|
||||||
|
|
||||||
/* Compute normal distance between non-displayed entries. */
|
/* Compute normal distance between non-displayed entries. */
|
||||||
|
@@ -794,6 +794,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
437,
|
||||||
/**/
|
/**/
|
||||||
436,
|
436,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user