diff src/evalfunc.c @ 24618:4aebea72c397 v8.2.2848

patch 8.2.2848: crash whn calling partial Commit: https://github.com/vim/vim/commit/fe8ebdbe5c4e116311c0c0d5937b89ded5c92d01 Author: Dominique Pelle <dominique.pelle@gmail.com> Date: Thu May 13 14:55:55 2021 +0200 patch 8.2.2848: crash whn calling partial Problem: Crash whn calling partial. Solution: Check for NULL pointer. (Dominique Pell?, closes https://github.com/vim/vim/issues/8202)
author Bram Moolenaar <Bram@vim.org>
date Thu, 13 May 2021 15:00:06 +0200
parents 07b3d21a8b4b
children 661d15592d3c
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -1971,7 +1971,7 @@ internal_func_name(int idx)
 }
 
 /*
- * Check the argument types for builting function "idx".
+ * Check the argument types for builtin function "idx".
  * Uses the list of types on the type stack: "types".
  * Return FAIL and gives an error message when a type is wrong.
  */
@@ -2475,8 +2475,8 @@ f_call(typval_T *argvars, typval_T *rett
     }
     else
 	func = 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
 
     if (argvars[2].v_type != VAR_UNKNOWN)
     {
@@ -2779,7 +2779,7 @@ f_cosh(typval_T *argvars, typval_T *rett
 
 /*
  * Set the cursor position.
- * If 'charcol' is TRUE, then use the column number as a character offet.
+ * If 'charcol' is TRUE, then use the column number as a character offset.
  * Otherwise use the column number as a byte offset.
  */
     static void