0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.1.0905: complicated regexp causes a crash

Problem:    Complicated regexp causes a crash. (Kuang-che Wu)
Solution:   Limit the recursiveness of addstate(). (closes #3941)
This commit is contained in:
Bram Moolenaar
2019-02-12 23:05:46 +01:00
parent 00f148d2f2
commit 5567ad48b6
3 changed files with 73 additions and 18 deletions

View File

@@ -84,3 +84,9 @@ func Test_multi_failure()
call assert_fails('/a\{a}', 'E870:')
set re=0
endfunc
func Test_recursive_addstate()
" This will call addstate() recursively until it runs into the limit.
let lnum = search('\v((){328}){389}')
call assert_equal(0, lnum)
endfunc