diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-10-05 19:19:35 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-10-05 19:19:35 +0100 |
commit | 7c25a7c0a129300d0632e5b99ccefdca9bf3ffa2 (patch) | |
tree | 075354dd0bac168c233913853f1ba866e6d47341 /src | |
parent | f67d3fb7363ebc9454f9bb582de3978609a4fd6b (diff) |
patch 8.2.3479: crash when calling job_start with an invalid argumentv8.2.3479
Problem: Crash when calling job_start with an invalid argument. (Virginia
Senioria)
Solution: Clear the first item in argv. (closes #8957)
Diffstat (limited to 'src')
-rw-r--r-- | src/misc2.c | 1 | ||||
-rw-r--r-- | src/testdir/test_channel.vim | 4 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 7 insertions, 0 deletions
diff --git a/src/misc2.c b/src/misc2.c index 2436f9fb06..8e01434eae 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -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); diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index fa510c7bbc..fbe6a84287 100644 --- 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 index fa64466568..96e7606056 100644 --- 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, |