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.
bc197195b0
This commit is contained in:
Jan Edmund Lazo 2018-08-10 10:41:26 -04:00
parent 5ed303c22b
commit cb708d203b

View File

@ -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--;