0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

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 #7040)
This commit is contained in:
Bram Moolenaar 2020-09-29 21:45:41 +02:00
parent f43e7ac4ee
commit 1b9129809d
3 changed files with 6 additions and 0 deletions

View File

@ -2304,6 +2304,8 @@ f_mapset(typval_T *argvars, typval_T *rettv UNUSED)
char_u *arg;
which = tv_get_string_buf_chk(&argvars[0], buf);
if (which == NULL)
return;
mode = get_map_mode(&which, 0);
is_abbr = (int)tv_get_number(&argvars[1]);

View File

@ -238,6 +238,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)

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1773,
/**/
1772,
/**/