summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-26 14:29:56 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-26 14:29:56 +0200
commit7d41aa8874a62eb399e13b94add7f0e5c4dd074b (patch)
treea8780ab182085d69c76f3730de4d2d2e057a5e27
parent6378c4fef37df05c99e8a43616063b4ddb692876 (diff)
patch 8.2.0642: Vim9: using invalid indexv8.2.0642
Problem: Vim9: using invalid index. Solution: Check index for being valid. Fix memory leak.
-rw-r--r--src/clientserver.c1
-rw-r--r--src/version.c2
-rw-r--r--src/vim9compile.c5
3 files changed, 6 insertions, 2 deletions
diff --git a/src/clientserver.c b/src/clientserver.c
index 5245425803..cf35c8149f 100644
--- a/src/clientserver.c
+++ b/src/clientserver.c
@@ -473,6 +473,7 @@ cmdsrv_main(
# ifdef FEAT_GUI_MSWIN
Shell_NotifyIcon(NIM_DELETE, &ni);
# endif
+ vim_free(done);
}
}
else if (STRICMP(argv[i], "--remote-expr") == 0)
diff --git a/src/version.c b/src/version.c
index 3829af5b3f..590c392177 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 642,
+/**/
641,
/**/
640,
diff --git a/src/vim9compile.c b/src/vim9compile.c
index ccd73f77fa..0e9abac0e4 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -5822,12 +5822,13 @@ compile_mult_expr(char_u *arg, int cmdidx, cctx_T *cctx)
compile_exec(char_u *line, exarg_T *eap, cctx_T *cctx)
{
char_u *p;
- int has_expr;
+ int has_expr = FALSE;
if (cctx->ctx_skip == TRUE)
goto theend;
- has_expr = (excmd_get_argt(eap->cmdidx) & (EX_XFILE | EX_EXPAND));
+ if (eap->cmdidx >= 0 && eap->cmdidx < CMD_SIZE)
+ has_expr = (excmd_get_argt(eap->cmdidx) & (EX_XFILE | EX_EXPAND));
if (eap->cmdidx == CMD_syntax && STRNCMP(eap->arg, "include ", 8) == 0)
{
// expand filename in "syntax include [@group] filename"