]> granicus.if.org Git - vim/commitdiff
patch 8.2.0394: Coverity complains about using NULL pointer v8.2.0394
authorBram Moolenaar <Bram@vim.org>
Mon, 16 Mar 2020 19:27:38 +0000 (20:27 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 16 Mar 2020 19:27:38 +0000 (20:27 +0100)
Problem:    Coverity complains about using NULL pointer.
Solution:   Use empty string when option value is NULL.

src/optionstr.c
src/version.c

index af4b749f26665f9403babb56cdbaf62c7d295e0d..1cf1ee9dfc1438db8f76457784065634feca0417 100644 (file)
@@ -500,7 +500,7 @@ set_string_option(
     if (is_hidden_option(opt_idx))     // don't set hidden option
        return NULL;
 
-    s = vim_strsave(value);
+    s = vim_strsave(value == NULL ? (char_u *)"" : value);
     if (s != NULL)
     {
        varp = (char_u **)get_option_varp_scope(opt_idx,
index b0497a52c0de8a499643609bfd59291da1840b05..717ca669e891d3db2fa25865ccf298a0d1454775 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    394,
 /**/
     393,
 /**/