Skip to content

Commit bc19719

Browse files
committed
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.
1 parent b3292fa commit bc19719

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/regexp.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5585,9 +5585,14 @@ regmatch(
55855585
{
55865586
#ifdef FEAT_MBYTE
55875587
if (has_mbyte)
5588+
{
5589+
char_u *line =
5590+
reg_getline(behind_pos.rs_u.pos.lnum);
5591+
55885592
rp->rs_un.regsave.rs_u.pos.col -=
5589-
(*mb_head_off)(regline, regline
5593+
(*mb_head_off)(line, line
55905594
+ rp->rs_un.regsave.rs_u.pos.col - 1) + 1;
5595+
}
55915596
else
55925597
#endif
55935598
--rp->rs_un.regsave.rs_u.pos.col;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static char *(features[]) =
771771

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1517,
774776
/**/
775777
1516,
776778
/**/

0 commit comments

Comments
 (0)