mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 23:38:17 +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];
|
||||
const char *which = tv_get_string_buf_chk(&argvars[0], buf);
|
||||
int mode = get_map_mode((char **)&which, 0);
|
||||
bool is_abbr = tv_get_number(&argvars[1]) != 0;
|
||||
if (which == NULL) {
|
||||
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) {
|
||||
emsg(_(e_dictreq));
|
||||
|
@@ -239,6 +239,8 @@ func Test_mapset()
|
||||
iunmap K
|
||||
let &cpo = cpo_save
|
||||
bwipe!
|
||||
|
||||
call assert_fails('call mapset([], v:false, {})', 'E730:')
|
||||
endfunc
|
||||
|
||||
func Check_ctrlb_map(d, check_alt)
|
||||
|
Reference in New Issue
Block a user