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/list.c | |
parent | 6fd3a4ba2320c4a95f02daef5f2ac76d3105d013 (diff) | |
download | vim-git-0d90e728fe089ff1bb34d6a17f5591a96b57f734.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/list.c')
-rw-r--r-- | src/list.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/list.c b/src/list.c index 1da4f3d0c..beea6fae6 100644 --- a/src/list.c +++ b/src/list.c @@ -2552,8 +2552,11 @@ f_reduce(typval_T *argvars, typval_T *rettv) } else func_name = tv_get_string(&argvars[1]); - if (*func_name == NUL) - return; // type error or empty name + if (func_name == NULL || *func_name == NUL) + { + emsg(_(e_missing_function_argument)); + return; + } vim_memset(&funcexe, 0, sizeof(funcexe)); funcexe.evaluate = TRUE; |