0
0
mirror of https://github.com/vim/vim.git synced 2025-10-06 05:44:14 -04:00

patch 8.2.3479: crash when calling job_start with an invalid argument

Problem:    Crash when calling job_start with an invalid argument. (Virginia
            Senioria)
Solution:   Clear the first item in argv. (closes #8957)
This commit is contained in:
Bram Moolenaar
2021-10-05 19:19:35 +01:00
parent f67d3fb736
commit 7c25a7c0a1
3 changed files with 7 additions and 0 deletions

View File

@@ -2953,6 +2953,7 @@ build_argv_from_list(list_T *l, char ***argv, int *argc)
for (i = 0; i < *argc; ++i)
VIM_CLEAR((*argv)[i]);
(*argv)[0] = NULL;
return FAIL;
}
(*argv)[*argc] = (char *)vim_strsave(s);

View File

@@ -2362,5 +2362,9 @@ func Test_parse_messages_in_autocmd()
augroup END
endfunc
func Test_job_start_with_invalid_argument()
call assert_fails('call job_start([0zff])', 'E976:')
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

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