aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-03-07 06:05:22 -0500
committerJustin M. Keyes <justinkz@gmail.com>2019-03-07 12:05:22 +0100
commit5f84b1dc4154ea8def87b6113fa9b9ed058d83d2 (patch)
tree64cc7986d62463715073960852dcfc56420d6c97 /src/nvim/regexp.c
parentb51e5d8b8dd2b5e7c5986f19bdf4130226b47379 (diff)
downloadrneovim-5f84b1dc4154ea8def87b6113fa9b9ed058d83d2.tar.gz
rneovim-5f84b1dc4154ea8def87b6113fa9b9ed058d83d2.tar.bz2
rneovim-5f84b1dc4154ea8def87b6113fa9b9ed058d83d2.zip
vim-patch:8.1.0935: old regexp engine may use invalid buffer #9692
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 vim/vim#3972) https://github.com/vim/vim/commit/8bfd9469cef536f171e6666f9d9217192e09d161
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r--src/nvim/regexp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 3b3ca29dad..c043d4a173 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -7116,6 +7116,8 @@ regprog_T *vim_regcomp(char_u *expr_arg, int re_flags)
}
bt_regengine.expr = expr;
nfa_regengine.expr = expr;
+ // reg_iswordc() uses rex.reg_buf
+ rex.reg_buf = curbuf;
//
// First try the NFA engine, unless backtracking was requested.