comparison src/regexp_bt.c @ 27829:0138ce89703b v8.2.4440

patch 8.2.4440: crash with specific regexp pattern and string Commit: https://github.com/vim/vim/commit/6456fae9ba8e72c74b2c0c499eaf09974604ff30 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 22 13:37:31 2022 +0000 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.
author Bram Moolenaar <Bram@vim.org>
date Tue, 22 Feb 2022 14:45:03 +0100
parents fb4c30606b4a
children 692f6a861c47
comparison
equal deleted inserted replaced
27828:604ca01b14e4 27829:0138ce89703b
4613 if (--rst->count < rst->minval) 4613 if (--rst->count < rst->minval)
4614 break; 4614 break;
4615 if (rex.input == rex.line) 4615 if (rex.input == rex.line)
4616 { 4616 {
4617 // backup to last char of previous line 4617 // backup to last char of previous line
4618 if (rex.lnum == 0)
4619 {
4620 status = RA_NOMATCH;
4621 break;
4622 }
4618 --rex.lnum; 4623 --rex.lnum;
4619 rex.line = reg_getline(rex.lnum); 4624 rex.line = reg_getline(rex.lnum);
4620 // Just in case regrepeat() didn't count 4625 // Just in case regrepeat() didn't count
4621 // right. 4626 // right.
4622 if (rex.line == NULL) 4627 if (rex.line == NULL)