summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-04-10 21:38:38 +0200
committerBram Moolenaar <Bram@vim.org>2021-04-10 21:38:38 +0200
commitfed9e830fcffa90cf73dd125a27d27ed7eafbd68 (patch)
treeb4f4e3ed1252d5ff41aa99c3b1424f65181c2264
parentda479c7597a61c4d50c842df21c9294bd9bf1037 (diff)
downloadvim-git-fed9e830fcffa90cf73dd125a27d27ed7eafbd68.tar.gz
patch 8.2.2751: Coverity warns for using NULL pointerv8.2.2751
Problem: Coverity warns for using NULL pointer. Solution: Check for NULL in calling function.
-rw-r--r--src/userfunc.c6
-rw-r--r--src/version.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index 522112607..54335d41f 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -973,8 +973,7 @@ lambda_function_body(
garray_T *default_args,
char_u *ret_type)
{
- int evaluate = evalarg != NULL
- && (evalarg->eval_flags & EVAL_EVALUATE);
+ int evaluate = (evalarg->eval_flags & EVAL_EVALUATE);
ufunc_T *ufunc = NULL;
exarg_T eap;
garray_T newlines;
@@ -1180,6 +1179,9 @@ get_lambda_tv(
// Recognize "{" as the start of a function body.
if (equal_arrow && **arg == '{')
{
+ if (evalarg == NULL)
+ // cannot happen?
+ goto theend;
if (lambda_function_body(arg, rettv, evalarg, pnewargs,
types_optional ? &argtypes : NULL, varargs,
&default_args, ret_type) == FAIL)
diff --git a/src/version.c b/src/version.c
index ed2237532..2e0d3132b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2751,
+/**/
2750,
/**/
2749,