From a77e5b3606bd40e524e5e3ab428b58ca2b3f0ac2 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 25 Jul 2019 01:41:42 -0400 Subject: vim-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 vim/vim#3941) https://github.com/vim/vim/commit/5567ad48b66dff13670af52a48509059acc34dfe --- src/nvim/testdir/test_regexp_latin.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_regexp_latin.vim b/src/nvim/testdir/test_regexp_latin.vim index de209fa9ec..5fb6e78baa 100644 --- a/src/nvim/testdir/test_regexp_latin.vim +++ b/src/nvim/testdir/test_regexp_latin.vim @@ -85,3 +85,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 -- cgit