mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 7.4.825
Problem: Invalid memory access for ":syn keyword x a[". Solution: Do not skip over the NUL. (Dominique Pelle)
This commit is contained in:
11
src/syntax.c
11
src/syntax.c
@@ -4873,11 +4873,16 @@ syn_cmd_keyword(eap, syncing)
|
|||||||
if (p[1] == NUL)
|
if (p[1] == NUL)
|
||||||
{
|
{
|
||||||
EMSG2(_("E789: Missing ']': %s"), kw);
|
EMSG2(_("E789: Missing ']': %s"), kw);
|
||||||
kw = p + 2; /* skip over the NUL */
|
goto error;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if (p[1] == ']')
|
if (p[1] == ']')
|
||||||
{
|
{
|
||||||
|
if (p[2] != NUL)
|
||||||
|
{
|
||||||
|
EMSG3(_("E890: trailing char after ']': %s]%s"),
|
||||||
|
kw, &p[2]);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
kw = p + 1; /* skip over the "]" */
|
kw = p + 1; /* skip over the "]" */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -4898,7 +4903,7 @@ syn_cmd_keyword(eap, syncing)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
error:
|
||||||
vim_free(keyword_copy);
|
vim_free(keyword_copy);
|
||||||
vim_free(syn_opt_arg.cont_in_list);
|
vim_free(syn_opt_arg.cont_in_list);
|
||||||
vim_free(syn_opt_arg.next_list);
|
vim_free(syn_opt_arg.next_list);
|
||||||
|
@@ -741,6 +741,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 */
|
||||||
|
/**/
|
||||||
|
825,
|
||||||
/**/
|
/**/
|
||||||
824,
|
824,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user