forked from aniani/vim
patch 8.1.0935: old regexp engine may use invalid buffer
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)
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user