aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-10 10:41:26 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-11 14:32:59 -0400
commitcb708d203b36fff16b6f01a81c30ca20b51c82fc (patch)
tree1d532cf4bc065d2f4d442e4132e3256d64efe27b
parent5ed303c22b52ac1edc438b6e2edc44df1684974d (diff)
downloadrneovim-cb708d203b36fff16b6f01a81c30ca20b51c82fc.tar.gz
rneovim-cb708d203b36fff16b6f01a81c30ca20b51c82fc.tar.bz2
rneovim-cb708d203b36fff16b6f01a81c30ca20b51c82fc.zip
vim-patch:8.0.1517: invalid memory acces with pattern using look-behind match
Problem: Invalid memory acces with pattern using look-behind match. (Dominique Pelle) Solution: Get a pointer to the right line. https://github.com/vim/vim/commit/bc197195b097707d08fd44a476dbc374366504cb
-rw-r--r--src/nvim/regexp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 9bfc158763..9d16ecb46c 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -4922,8 +4922,11 @@ regmatch (
}
} else {
if (has_mbyte) {
+ const char_u *const line =
+ reg_getline(behind_pos.rs_u.pos.lnum);
+
rp->rs_un.regsave.rs_u.pos.col -=
- (*mb_head_off)(regline, regline
+ (*mb_head_off)(line, line
+ rp->rs_un.regsave.rs_u.pos.col - 1) + 1;
} else {
rp->rs_un.regsave.rs_u.pos.col--;