]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4034: Coverity warns for possibly using a NULL pointer v8.2.4034
authorBram Moolenaar <Bram@vim.org>
Fri, 7 Jan 2022 20:18:16 +0000 (20:18 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 7 Jan 2022 20:18:16 +0000 (20:18 +0000)
Problem:    Coverity warns for possibly using a NULL pointer.
Solution:   Check v_partial is not NULL.

src/version.c
src/vim9type.c

index 7f01ebe9f3a533ae3311e8a8dabf85ec0d2e3451..e2b5023e35cbd4a9c7102a08cad9fde2c3b2d3c6 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4034,
 /**/
     4033,
 /**/
index f28b88f2365ee650d62395952053470d36290dc8..6671f5e3d44c2568adecc5edfdf1dfd65bae1543 100644 (file)
@@ -375,7 +375,7 @@ typval2type_int(typval_T *tv, int copyID, garray_T *type_gap, int flags)
                set_function_type(ufunc);
            if (ufunc->uf_func_type != NULL)
            {
-               if (tv->v_type == VAR_PARTIAL
+               if (tv->v_type == VAR_PARTIAL && tv->vval.v_partial != NULL
                                            && tv->vval.v_partial->pt_argc > 0)
                {
                    type = get_type_ptr(type_gap);