1
0
forked from aniani/vim

patch 8.2.4440: crash with specific regexp pattern and string

Problem:    Crash with specific regexp pattern and string.
Solution:   Stop at the start of the string.
This commit is contained in:
Bram Moolenaar
2022-02-22 13:37:31 +00:00
parent 1349bd712c
commit 6456fae9ba
3 changed files with 17 additions and 2 deletions

View File

@@ -4615,6 +4615,11 @@ regmatch(
if (rex.input == rex.line)
{
// backup to last char of previous line
if (rex.lnum == 0)
{
status = RA_NOMATCH;
break;
}
--rex.lnum;
rex.line = reg_getline(rex.lnum);
// Just in case regrepeat() didn't count