diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-02-16 18:07:57 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-02-16 18:07:57 +0100 |
commit | 8bfd9469cef536f171e6666f9d9217192e09d161 (patch) | |
tree | 1f5b859c8c2b118440a067103edf130120300ca3 /src/regexp.c | |
parent | 985079c514e9ab85598b7bca019c77d3e42526f5 (diff) | |
download | vim-git-8bfd9469cef536f171e6666f9d9217192e09d161.tar.gz |
patch 8.1.0935: old regexp engine may use invalid bufferv8.1.0935
Problem: Old regexp engine may use invalid buffer for 'iskeyword' or
uninitialized buffer pointer. (Kuang-che Wu)
Solution: Set rex.reg_buf when compiling the pattern. (closes #3972)
Diffstat (limited to 'src/regexp.c')
-rw-r--r-- | src/regexp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/regexp.c b/src/regexp.c index 30a604b23..836204895 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -7998,6 +7998,8 @@ vim_regcomp(char_u *expr_arg, int re_flags) bt_regengine.expr = expr; nfa_regengine.expr = expr; #endif + // reg_iswordc() uses rex.reg_buf + rex.reg_buf = curbuf; /* * First try the NFA engine, unless backtracking was requested. |