mirror of
https://github.com/neovim/neovim.git
synced 2025-09-15 07:48:18 +00:00
vim-patch:8.2.1773: crash when calling mapset() with a list as first argument
Problem: Crash when calling mapset() with a list as first argument.
Solution: Check for NULL. (closes vim/vim#7040)
1b9129809d
This commit is contained in:
@@ -2132,8 +2132,11 @@ void f_mapset(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
{
|
{
|
||||||
char buf[NUMBUFLEN];
|
char buf[NUMBUFLEN];
|
||||||
const char *which = tv_get_string_buf_chk(&argvars[0], buf);
|
const char *which = tv_get_string_buf_chk(&argvars[0], buf);
|
||||||
int mode = get_map_mode((char **)&which, 0);
|
if (which == NULL) {
|
||||||
bool is_abbr = tv_get_number(&argvars[1]) != 0;
|
return;
|
||||||
|
}
|
||||||
|
const int mode = get_map_mode((char **)&which, 0);
|
||||||
|
const bool is_abbr = tv_get_number(&argvars[1]) != 0;
|
||||||
|
|
||||||
if (argvars[2].v_type != VAR_DICT) {
|
if (argvars[2].v_type != VAR_DICT) {
|
||||||
emsg(_(e_dictreq));
|
emsg(_(e_dictreq));
|
||||||
|
@@ -239,6 +239,8 @@ func Test_mapset()
|
|||||||
iunmap K
|
iunmap K
|
||||||
let &cpo = cpo_save
|
let &cpo = cpo_save
|
||||||
bwipe!
|
bwipe!
|
||||||
|
|
||||||
|
call assert_fails('call mapset([], v:false, {})', 'E730:')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Check_ctrlb_map(d, check_alt)
|
func Check_ctrlb_map(d, check_alt)
|
||||||
|
Reference in New Issue
Block a user