aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/funcs.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-16 08:55:42 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-04-16 10:15:15 +0800
commit08121ef69f47f8ad8f8903a732920412e24d30c1 (patch)
tree82b56291fc2e45d3d668fb4f125312912d7c0df6 /src/nvim/eval/funcs.c
parentd13222649a2145272f14675d9bbf64bb72c43f64 (diff)
downloadrneovim-08121ef69f47f8ad8f8903a732920412e24d30c1.tar.gz
rneovim-08121ef69f47f8ad8f8903a732920412e24d30c1.tar.bz2
rneovim-08121ef69f47f8ad8f8903a732920412e24d30c1.zip
vim-patch:8.2.2848: crash whn calling partial
Problem: Crash whn calling partial. Solution: Check for NULL pointer. (Dominique Pellé, closes vim/vim#8202) https://github.com/vim/vim/commit/fe8ebdbe5c4e116311c0c0d5937b89ded5c92d01 Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r--src/nvim/eval/funcs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index f94725e1cc..99e511a7a4 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -565,8 +565,8 @@ static void f_call(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
func = (char *)tv_get_string(&argvars[0]);
}
- if (*func == NUL) {
- return; // type error or empty name
+ if (func == NULL || *func == NUL) {
+ return; // type error, empty name or null function
}
dict_T *selfdict = NULL;
@@ -1136,7 +1136,7 @@ static void f_ctxsize(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
}
/// Set the cursor position.
-/// If 'charcol' is true, then use the column number as a character offset.
+/// If "charcol" is true, then use the column number as a character offset.
/// Otherwise use the column number as a byte offset.
static void set_cursorpos(typval_T *argvars, typval_T *rettv, bool charcol)
{