Blame SOURCES/0001-patch-8.2.4646-using-buffer-line-after-it-has-been-f.patch

bd8060
diff -up vim80/src/regexp.c.cve1154 vim80/src/regexp.c
bd8060
--- vim80/src/regexp.c.cve1154	2022-04-09 12:01:30.054452927 +0200
bd8060
+++ vim80/src/regexp.c	2022-04-09 12:02:48.987999877 +0200
bd8060
@@ -4415,8 +4415,17 @@ regmatch(
bd8060
 		int	mark = OPERAND(scan)[0];
bd8060
 		int	cmp = OPERAND(scan)[1];
bd8060
 		pos_T	*pos;
bd8060
+		size_t	col = REG_MULTI ? reginput - regline : 0;
bd8060
 
bd8060
 		pos = getmark_buf(rex.reg_buf, mark, FALSE);
bd8060
+
bd8060
+		// Line may have been freed, get it again.
bd8060
+		if (REG_MULTI)
bd8060
+		{
bd8060
+		    regline = reg_getline(reglnum);
bd8060
+		    reginput = regline + col;
bd8060
+		}
bd8060
+
bd8060
 		if (pos == NULL		     /* mark doesn't exist */
bd8060
 			|| pos->lnum <= 0    /* mark isn't set in reg_buf */
bd8060
 			|| (pos->lnum == reglnum + rex.reg_firstlnum
bd8060
diff -up vim80/src/testdir/test_regexp_latin.vim.cve1154 vim80/src/testdir/test_regexp_latin.vim