mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 02:46:31 +00:00
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)
fe8ebdbe5c
Co-authored-by: Dominique Pelle <dominique.pelle@gmail.com>
This commit is contained in:
@@ -4175,11 +4175,13 @@ int eval_interp_string(char **arg, typval_T *rettv, bool evaluate)
|
||||
char *partial_name(partial_T *pt)
|
||||
FUNC_ATTR_PURE
|
||||
{
|
||||
if (pt->pt_name != NULL) {
|
||||
return pt->pt_name;
|
||||
}
|
||||
if (pt->pt_func != NULL) {
|
||||
return pt->pt_func->uf_name;
|
||||
if (pt != NULL) {
|
||||
if (pt->pt_name != NULL) {
|
||||
return pt->pt_name;
|
||||
}
|
||||
if (pt->pt_func != NULL) {
|
||||
return pt->pt_func->uf_name;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user