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.
diff --git a/src/regexp_bt.c b/src/regexp_bt.c
index 5f5e58f..4082f59 100644
--- a/src/regexp_bt.c
+++ b/src/regexp_bt.c
@@ -4615,6 +4615,11 @@
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