changeset 7258:7245d8635ac7 v7.4.937

commit https://github.com/vim/vim/commit/5ad075c0735d3d8b97708d17c22de8facb15f997 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Nov 24 15:18:32 2015 +0100 patch 7.4.937 Problem: Segfault reading unitialized memory. Solution: Do not read match \z0, it does not exist. (Marius Gedminas, closes https://github.com/vim/vim/issues/497)
author Christian Brabandt <cb@256bit.org>
date Tue, 24 Nov 2015 15:30:05 +0100
parents a49ad3a505cf
children 9369e07b5ca7
files src/regexp_nfa.c src/version.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -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)
 	    {
--- 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 */
 /**/
+    937,
+/**/
     936,
 /**/
     935,