From: Bram Moolenaar Date: Tue, 13 Feb 2018 15:35:06 +0000 (+0100) Subject: patch 8.0.1517: invalid memory acces with pattern using look-behind match X-Git-Tag: v8.0.1517 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc197195b097707d08fd44a476dbc374366504cb;p=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. --- diff --git a/src/regexp.c b/src/regexp.c index d07391eef..b1cad99c3 100644 --- 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; diff --git a/src/version.c b/src/version.c index 9e1983342..931037d3d 100644 --- a/src/version.c +++ b/src/version.c @@ -771,6 +771,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1517, /**/ 1516, /**/