patch 8.2.2848: crash whn calling partial
Problem: Crash whn calling partial.
Solution: Check for NULL pointer. (Dominique Pellé, closes #8202)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 6a22449..e740f91 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -1971,7 +1971,7 @@
}
/*
- * 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 @@
}
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 @@
/*
* 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