]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.1258 v7.3.1258
authorBram Moolenaar <Bram@vim.org>
Fri, 28 Jun 2013 21:04:42 +0000 (23:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 28 Jun 2013 21:04:42 +0000 (23:04 +0200)
Problem:    Using submatch() may crash Vim. (Ingo Karkat)
Solution:   Restore the number of subexpressions used.

src/regexp_nfa.c
src/version.c

index 8146d9d61edd4c1be45ea5ce89c99707d38c2c5b..bd3818d71e8e89b61af2ec620b1b76da2e361087 100644 (file)
@@ -5198,6 +5198,8 @@ nfa_regmatch(prog, start, submatch, m)
                         || t->state->c == NFA_START_INVISIBLE_BEFORE_FIRST
                         || t->state->c == NFA_START_INVISIBLE_BEFORE_NEG_FIRST)
                    {
+                       int in_use = m->norm.in_use;
+
                        /* Copy submatch info for the recursive call, so that
                         * \1 can be matched. */
                        copy_sub_off(&m->norm, &t->subs.norm);
@@ -5231,6 +5233,7 @@ nfa_regmatch(prog, start, submatch, m)
                            add_here = TRUE;
                            add_state = t->state->out1->out;
                        }
+                       m->norm.in_use = in_use;
                    }
                    else
                    {
index 4980ae5700d767c91f6cfb99963bdd381a135aa3..d8a6f3804e303a0d98b7c01c66e15d7d79742009 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1258,
 /**/
     1257,
 /**/