]> granicus.if.org Git - vim/commitdiff
patch 9.0.0558: Coverity warns for possibly using NULL pointer v9.0.0558
authorBram Moolenaar <Bram@vim.org>
Fri, 23 Sep 2022 15:37:18 +0000 (16:37 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 23 Sep 2022 15:37:18 +0000 (16:37 +0100)
Problem:    Coverity warns for possibly using NULL pointer.
Solution:   Only use "evalarg" when not NULL.

src/eval.c
src/version.c

index d369df5e01d17ee36e703f7c6b6dca59bf8854dd..0102bd70b5cb8ef729007424d02718c28c1b7421 100644 (file)
@@ -6380,7 +6380,8 @@ handle_subscript(
            **arg = NUL;
 
            idx = find_exported(rettv->vval.v_number, exp_name, &ufunc, &type,
-                           evalarg->eval_cctx, evalarg->eval_cstack, verbose);
+                      evalarg == NULL ? NULL : evalarg->eval_cctx,
+                      evalarg == NULL ? NULL : evalarg->eval_cstack, verbose);
            **arg = cc;
 
            if (idx < 0 && ufunc == NULL)
index f01afe3862bebfb20769347f3a27b0f6745f5ff3..48f2ca559beda0815880dbca8859732f36964607 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    558,
 /**/
     557,
 /**/