]> granicus.if.org Git - vim/commitdiff
patch 8.2.4269: Coverity warns for using a NULL pointer v8.2.4269
authorBram Moolenaar <Bram@vim.org>
Mon, 31 Jan 2022 11:44:48 +0000 (11:44 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 31 Jan 2022 11:44:48 +0000 (11:44 +0000)
Problem:    Coverity warns for using a NULL pointer.
Solution:   Check for "name" to not be NULL.

src/userfunc.c
src/version.c

index 747e4d47787228ad05ab29df2687cdb99d87e586..371cfd328a5086627db517bad563c882d9a09678 100644 (file)
@@ -4232,7 +4232,8 @@ define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free)
                name = prefixed;
            }
        }
-       else if (vim9script && vim_strchr(name, AUTOLOAD_CHAR) != NULL)
+       else if (vim9script && name != NULL
+                                   && vim_strchr(name, AUTOLOAD_CHAR) != NULL)
        {
            emsg(_(e_cannot_use_name_with_hash_in_vim9_script_use_export_instead));
            goto ret_free;
index abc67424c61dfa32775977965b9e4be56ec7f38d..87f3845626dad90b101dccad2d1b3de238fede1f 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4269,
 /**/
     4268,
 /**/