]> granicus.if.org Git - vim/commitdiff
patch 8.0.1512: warning for possibly using NULL pointer v8.0.1512
authorBram Moolenaar <Bram@vim.org>
Tue, 13 Feb 2018 12:12:11 +0000 (13:12 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 13 Feb 2018 12:12:11 +0000 (13:12 +0100)
Problem:    Warning for possibly using NULL pointer. (Coverity)
Solution:   Skip using the pointer if it's NULL.

src/ex_cmds.c
src/version.c

index 788e9eb8282395df3ebc1848d1ab3370dc376763..a4d6221b013e91be27d85e9334ea04940a31a983 100644 (file)
@@ -6918,7 +6918,7 @@ fix_help_buffer(void)
                copy_option_part(&p, NameBuff, MAXPATHL, ",");
                mustfree = FALSE;
                rt = vim_getenv((char_u *)"VIMRUNTIME", &mustfree);
-               if (fullpathcmp(rt, NameBuff, FALSE) != FPC_SAME)
+               if (rt != NULL && fullpathcmp(rt, NameBuff, FALSE) != FPC_SAME)
                {
                    int         fcount;
                    char_u      **fnames;
index a9643caea86a3a7e34dae34c638d53f8f58f66fe..965df225a231eadc0b3a4b4d0d92e8f3033d5d93 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1512,
 /**/
     1511,
 /**/