]> granicus.if.org Git - vim/commitdiff
patch 7.4.825 v7.4.825
authorBram Moolenaar <Bram@vim.org>
Thu, 13 Aug 2015 20:53:29 +0000 (22:53 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 13 Aug 2015 20:53:29 +0000 (22:53 +0200)
Problem:    Invalid memory access for ":syn keyword x a[".
Solution:   Do not skip over the NUL. (Dominique Pelle)

src/syntax.c
src/version.c

index e4ae0b1ae7bcbc0b47faebd2e49fab5cf429b6d6..c28a24c5ceef3966c8d4881911cb8af3dd924cc6 100644 (file)
@@ -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);
index da75ff162aefd9e3698b7fab1ccdede0a3343bfc..fd9bf1878bdf2731321e07c091c6f8b03aa8b8c4 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    825,
 /**/
     824,
 /**/