comparison 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
comparison
equal deleted inserted replaced
24617:62ec7b94e2b1 24618:4aebea72c397
1969 { 1969 {
1970 return global_functions[idx].f_name; 1970 return global_functions[idx].f_name;
1971 } 1971 }
1972 1972
1973 /* 1973 /*
1974 * Check the argument types for builting function "idx". 1974 * Check the argument types for builtin function "idx".
1975 * Uses the list of types on the type stack: "types". 1975 * Uses the list of types on the type stack: "types".
1976 * Return FAIL and gives an error message when a type is wrong. 1976 * Return FAIL and gives an error message when a type is wrong.
1977 */ 1977 */
1978 int 1978 int
1979 internal_func_check_arg_types( 1979 internal_func_check_arg_types(
2473 partial = argvars[0].vval.v_partial; 2473 partial = argvars[0].vval.v_partial;
2474 func = partial_name(partial); 2474 func = partial_name(partial);
2475 } 2475 }
2476 else 2476 else
2477 func = tv_get_string(&argvars[0]); 2477 func = tv_get_string(&argvars[0]);
2478 if (*func == NUL) 2478 if (func == NULL || *func == NUL)
2479 return; // type error or empty name 2479 return; // type error, empty name or null function
2480 2480
2481 if (argvars[2].v_type != VAR_UNKNOWN) 2481 if (argvars[2].v_type != VAR_UNKNOWN)
2482 { 2482 {
2483 if (argvars[2].v_type != VAR_DICT) 2483 if (argvars[2].v_type != VAR_DICT)
2484 { 2484 {
2777 } 2777 }
2778 #endif 2778 #endif
2779 2779
2780 /* 2780 /*
2781 * Set the cursor position. 2781 * Set the cursor position.
2782 * If 'charcol' is TRUE, then use the column number as a character offet. 2782 * If 'charcol' is TRUE, then use the column number as a character offset.
2783 * Otherwise use the column number as a byte offset. 2783 * Otherwise use the column number as a byte offset.
2784 */ 2784 */
2785 static void 2785 static void
2786 set_cursorpos(typval_T *argvars, typval_T *rettv, int charcol) 2786 set_cursorpos(typval_T *argvars, typval_T *rettv, int charcol)
2787 { 2787 {