summaryrefslogtreecommitdiffstats
path: root/src/regexp.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-02-16 18:07:57 +0100
committerBram Moolenaar <Bram@vim.org>2019-02-16 18:07:57 +0100
commit8bfd9469cef536f171e6666f9d9217192e09d161 (patch)
tree1f5b859c8c2b118440a067103edf130120300ca3 /src/regexp.c
parent985079c514e9ab85598b7bca019c77d3e42526f5 (diff)
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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/regexp.c b/src/regexp.c
index 30a604b236..8362048951 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.