mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
vim-patch:9.0.1444: crash when passing NULL to setcmdline() (#23048)
Problem: Crash when passing NULL to setcmdline(). (Andreas Louv)
Solution: Use tv_get_string() instead of using v_string directly.
(closes vim/vim#12231, closes vim/vim#12227)
ac6cd31afc
This commit is contained in:
@@ -4209,7 +4209,8 @@ void f_setcmdline(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
}
|
||||
}
|
||||
|
||||
rettv->vval.v_number = set_cmdline_str(argvars[0].vval.v_string, pos);
|
||||
// Use tv_get_string() to handle a NULL string like an empty string.
|
||||
rettv->vval.v_number = set_cmdline_str(tv_get_string(&argvars[0]), pos);
|
||||
}
|
||||
|
||||
/// "setcmdpos()" function
|
||||
|
Reference in New Issue
Block a user