diff options
| author | Bram Moolenaar <Bram@vim.org> | 2020-11-03 18:20:19 +0100 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2020-11-03 18:20:19 +0100 |
| commit | 0d90e728fe089ff1bb34d6a17f5591a96b57f734 (patch) | |
| tree | c4e8d1b172ee4660250ab06fa1d9781553e7f1c7 /src/testdir | |
| parent | 6fd3a4ba2320c4a95f02daef5f2ac76d3105d013 (diff) | |
| download | vim-git-8.2.1945.tar.gz | |
patch 8.2.1945: crash when passing NULL function to reduce()v8.2.1945
Problem: Crash when passing NULL function to reduce().
Solution: Check for NULL pointer and give an error. (Dominique Pellé,
closes #7243)
Diffstat (limited to 'src/testdir')
| -rw-r--r-- | src/testdir/test_listdict.vim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/testdir/test_listdict.vim b/src/testdir/test_listdict.vim index ade37f8c0..6a7fc4c68 100644 --- a/src/testdir/test_listdict.vim +++ b/src/testdir/test_listdict.vim @@ -740,6 +740,9 @@ func Test_reduce() call assert_equal(42, reduce(test_null_list(), function('add'), 42)) call assert_equal(42, reduce(test_null_blob(), function('add'), 42)) + + " should not crash + call assert_fails('echo reduce([1], test_null_function())', 'E1132:') endfunc " splitting a string to a List using split() |
