mirror of
https://github.com/vim/vim.git
synced 2025-11-15 23:14:06 -05:00
patch 8.0.1671: crash when passing non-dict argument as env to job_start()
Problem: Crash when passing non-dict argument as env to job_start(). Solution: Check for valid argument. (Ozaki Kiichi, closes #2765)
This commit is contained in:
@@ -4797,9 +4797,15 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
|
||||
{
|
||||
if (!(supported2 & JO2_ENV))
|
||||
break;
|
||||
if (item->v_type != VAR_DICT)
|
||||
{
|
||||
EMSG2(_(e_invargval), "env");
|
||||
return FAIL;
|
||||
}
|
||||
opt->jo_set2 |= JO2_ENV;
|
||||
opt->jo_env = item->vval.v_dict;
|
||||
++item->vval.v_dict->dv_refcount;
|
||||
if (opt->jo_env != NULL)
|
||||
++opt->jo_env->dv_refcount;
|
||||
}
|
||||
else if (STRCMP(hi->hi_key, "cwd") == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user