]> granicus.if.org Git - vim/commitdiff
patch 7.4.937 v7.4.937
authorBram Moolenaar <Bram@vim.org>
Tue, 24 Nov 2015 14:18:32 +0000 (15:18 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 24 Nov 2015 14:18:32 +0000 (15:18 +0100)
Problem:    Segfault reading unitialized memory.
Solution:   Do not read match \z0, it does not exist. (Marius Gedminas, closes
            #497)

src/regexp_nfa.c
src/version.c

index a21c3c03f89f67a433c76c6a21d0fd23c4d229a4..32108bee4c9fed258e896947455a97031f5a3b2f 100644 (file)
@@ -6947,7 +6947,8 @@ nfa_regtry(prog, col, tm)
     {
        cleanup_zsubexpr();
        re_extmatch_out = make_extmatch();
-       for (i = 0; i < subs.synt.in_use; i++)
+       /* Loop over \z1, \z2, etc.  There is no \z0. */
+       for (i = 1; i < subs.synt.in_use; i++)
        {
            if (REG_MULTI)
            {
index 9f0cfbf6a34836c86ea50a3aa5beb8dffdfe5713..82e5f350d1627ce4699f5127c26625358a6dd4fe 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    937,
 /**/
     936,
 /**/