mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 7.4.1665
Problem: Crash when calling job_start() with a NULL string. (Dominique) Solution: Check for an invalid argument.
This commit is contained in:
@@ -3812,6 +3812,11 @@ job_start(typval_T *argvars)
|
||||
{
|
||||
/* Command is a string. */
|
||||
cmd = argvars[0].vval.v_string;
|
||||
if (cmd == NULL || *cmd == NUL)
|
||||
{
|
||||
EMSG(_(e_invarg));
|
||||
return job;
|
||||
}
|
||||
#ifdef USE_ARGV
|
||||
if (mch_parse_cmd(cmd, FALSE, &argv, &argc) == FAIL)
|
||||
return job;
|
||||
|
@@ -1201,5 +1201,10 @@ func Test_close_callback()
|
||||
call s:run_server('s:test_close_callback')
|
||||
endfunc
|
||||
|
||||
func Test_job_start_invalid()
|
||||
call assert_fails('call job_start($x)', 'E474:')
|
||||
call assert_fails('call job_start("")', 'E474:')
|
||||
endfunc
|
||||
|
||||
" Uncomment this to see what happens, output is in src/testdir/channellog.
|
||||
" call ch_logfile('channellog', 'w')
|
||||
|
@@ -748,6 +748,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1665,
|
||||
/**/
|
||||
1664,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user