From ca5a810c4a67c9c3f482d0c015270c26aee2c943 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 6 May 2023 20:00:17 +0800 Subject: vim-patch:9.0.1511: crash when using wrong arg types to assert_match() (#23507) Problem: Crash when using wrong arg types to assert_match(). Solution: Check for NULL pointer. (closes vim/vim#12349) https://github.com/vim/vim/commit/12e7a1fe7527e9e59adbe248a95b4b532e3ec58c --- test/old/testdir/test_assert.vim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') diff --git a/test/old/testdir/test_assert.vim b/test/old/testdir/test_assert.vim index 57d11d0e3a..bc4e07e7c6 100644 --- a/test/old/testdir/test_assert.vim +++ b/test/old/testdir/test_assert.vim @@ -324,6 +324,23 @@ func Test_assert_fail_fails() call remove(v:errors, 0) endfunc +func Test_assert_wrong_arg_emsg_off() + CheckFeature folding + + new + call setline(1, ['foo', 'bar']) + 1,2fold + + " This used to crash Vim + let &l:foldtext = 'assert_match({}, {})' + redraw! + + let &l:foldtext = 'assert_equalfile({}, {})' + redraw! + + bwipe! +endfunc + func Test_assert_fails_in_try_block() try call assert_equal(0, assert_fails('throw "error"')) -- cgit