Mercurial > vim
changeset 13286:a90bc1e28cbb v8.0.1517
patch 8.0.1517: invalid memory acces with pattern using look-behind match
commit https://github.com/vim/vim/commit/bc197195b097707d08fd44a476dbc374366504cb
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Feb 13 16:35:06 2018 +0100
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 13 Feb 2018 16:45:05 +0100 |
parents | 546b2a354d13 |
children | 1e7db730688a |
files | src/regexp.c src/version.c |
diffstat | 2 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/regexp.c +++ b/src/regexp.c @@ -5585,9 +5585,14 @@ regmatch( { #ifdef FEAT_MBYTE if (has_mbyte) + { + char_u *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 #endif --rp->rs_un.regsave.rs_u.pos.col;