summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2015-08-13 22:53:29 +0200
committerBram Moolenaar <bram@vim.org>2015-08-13 22:53:29 +0200
commit65f87218bfc67c2c1649fe96fed98895c041b0e2 (patch)
tree6d6c85703f013c7f9dfe16a40ed232033a9d44f1
parent5365ebbcc6d4d3437d4c3646e6a493e30be55579 (diff)
downloadvim-65f87218bfc67c2c1649fe96fed98895c041b0e2.tar.gz
patch 7.4.825v7.4.825v7-4-825
Problem: Invalid memory access for ":syn keyword x a[". Solution: Do not skip over the NUL. (Dominique Pelle)
-rw-r--r--src/syntax.c11
-rw-r--r--src/version.c2
2 files changed, 10 insertions, 3 deletions
diff --git a/src/syntax.c b/src/syntax.c
index e4ae0b1a..c28a24c5 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -4873,11 +4873,16 @@ syn_cmd_keyword(eap, syncing)
if (p[1] == NUL)
{
EMSG2(_("E789: Missing ']': %s"), kw);
- kw = p + 2; /* skip over the NUL */
- break;
+ goto error;
}
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 "]" */
break;
}
@@ -4898,7 +4903,7 @@ syn_cmd_keyword(eap, syncing)
}
}
}
-
+error:
vim_free(keyword_copy);
vim_free(syn_opt_arg.cont_in_list);
vim_free(syn_opt_arg.next_list);
diff --git a/src/version.c b/src/version.c
index da75ff16..fd9bf187 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 825,
+/**/
824,
/**/
823,