diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-11-24 15:18:32 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-11-24 15:18:32 +0100 |
commit | 5ad075c0735d3d8b97708d17c22de8facb15f997 (patch) | |
tree | cd198bf91d17a897585d489642acf39205253289 | |
parent | 294a7e55b01149154807a23323038784549b8946 (diff) | |
download | vim-git-5ad075c0735d3d8b97708d17c22de8facb15f997.tar.gz |
patch 7.4.937v7.4.937
Problem: Segfault reading unitialized memory.
Solution: Do not read match \z0, it does not exist. (Marius Gedminas, closes
#497)
-rw-r--r-- | src/regexp_nfa.c | 3 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index a21c3c03f..32108bee4 100644 --- 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) { diff --git a/src/version.c b/src/version.c index 9f0cfbf6a..82e5f350d 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 */ /**/ + 937, +/**/ 936, /**/ 935, |