vim-patch:7.4.825

Problem:    Invalid memory access for ":syn keyword x a[".
Solution:   Do not skip over the NUL. (Dominique Pelle)

1560d07045
This commit is contained in:
Jurica Bradaric 2016-02-02 20:30:30 +01:00
parent 8d5cfe4ffc
commit 52692d3cd3
2 changed files with 8 additions and 5 deletions

View File

@ -4183,12 +4183,14 @@ static void syn_cmd_keyword(exarg_T *eap, int syncing)
break;
if (p[1] == NUL) {
EMSG2(_("E789: Missing ']': %s"), kw);
kw = p + 2; /* skip over the NUL */
break;
goto error;
}
if (p[1] == ']') {
kw = p + 1; /* skip over the "]" */
break;
if (p[2] != NUL) {
EMSG3(_("E890: trailing char after ']': %s]%s"),
kw, &p[2]);
goto error;
}
}
if (has_mbyte) {
int l = (*mb_ptr2len)(p + 1);
@ -4203,6 +4205,7 @@ static void syn_cmd_keyword(exarg_T *eap, int syncing)
}
}
error:
xfree(keyword_copy);
xfree(syn_opt_arg.cont_in_list);
xfree(syn_opt_arg.next_list);

View File

@ -463,7 +463,7 @@ static int included_patches[] = {
// 828,
// 827,
826,
// 825,
825,
// 824 NA
823,
// 822,