0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.2.4863: accessing freed memory in test without the +channel feature

Problem:    Accessing freed memory in test without the +channel feature.
            (Dominique Pellé)
Solution:   Do not generted PUSHCHANNEL or PUSHJOB if they are not
            implemented. (closes #10350)
This commit is contained in:
Bram Moolenaar
2022-05-04 16:46:54 +01:00
parent 23d44493f1
commit c9af617ac6
5 changed files with 45 additions and 14 deletions

View File

@@ -755,12 +755,19 @@ generate_PUSHS(cctx_T *cctx, char_u **str)
int
generate_PUSHCHANNEL(cctx_T *cctx)
{
#ifdef FEAT_JOB_CHANNEL
isn_T *isn;
#endif
RETURN_OK_IF_SKIP(cctx);
#ifdef FEAT_JOB_CHANNEL
if ((isn = generate_instr_type(cctx, ISN_PUSHCHANNEL, &t_channel)) == NULL)
return FAIL;
return OK;
#else
emsg(_(e_channel_job_feature_not_available));
return FAIL;
#endif
}
/*
@@ -769,12 +776,19 @@ generate_PUSHCHANNEL(cctx_T *cctx)
int
generate_PUSHJOB(cctx_T *cctx)
{
#ifdef FEAT_JOB_CHANNEL
isn_T *isn;
#endif
RETURN_OK_IF_SKIP(cctx);
#ifdef FEAT_JOB_CHANNEL
if ((isn = generate_instr_type(cctx, ISN_PUSHJOB, &t_job)) == NULL)
return FAIL;
return OK;
#else
emsg(_(e_channel_job_feature_not_available));
return FAIL;
#endif
}
/*