From f1843c0035769637daab88aa476753ce54d41387 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 7 Feb 2019 22:43:38 +0100 Subject: vim-patch:8.1.0677: look-behind match may use the wrong line number crash reported in #9584 Problem: Look-behind match may use the wrong line number. (Dominique Pelle) Solution: Use the line number in regsave instead of the one in behind_pos, we may be looking at the previous line. (closes vim/vim#3749) https://github.com/vim/vim/commit/866f3558141aa68862aa2fedbb7747bf2365e838 --- src/nvim/regexp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index d62a009fbc..0b9e1cfdec 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -4920,7 +4920,7 @@ regmatch ( } } else { const char_u *const line = - reg_getline(behind_pos.rs_u.pos.lnum); + reg_getline(rp->rs_un.regsave.rs_u.pos.lnum); rp->rs_un.regsave.rs_u.pos.col -= utf_head_off(line, -- cgit