# HG changeset patch # User Bram Moolenaar # Date 1633458604 -7200 # Node ID 58b1c9d96ec6e31845fab4fd9b3ed20db3f54dcf # Parent 7fb29ee9c3befad0a210975f7441ec81c455bc72 patch 8.2.3479: crash when calling job_start with an invalid argument Commit: https://github.com/vim/vim/commit/7c25a7c0a129300d0632e5b99ccefdca9bf3ffa2 Author: Bram Moolenaar Date: Tue Oct 5 19:19:35 2021 +0100 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) diff --git a/src/misc2.c b/src/misc2.c --- a/src/misc2.c +++ b/src/misc2.c @@ -2953,6 +2953,7 @@ build_argv_from_list(list_T *l, char *** for (i = 0; i < *argc; ++i) VIM_CLEAR((*argv)[i]); + (*argv)[0] = NULL; return FAIL; } (*argv)[*argc] = (char *)vim_strsave(s); diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -758,6 +758,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3479, +/**/ 3478, /**/ 3477,