changeset 19675:bee179e81f28 v8.2.0394

patch 8.2.0394: Coverity complains about using NULL pointer Commit: https://github.com/vim/vim/commit/7f009dfa064240d9024b76212535a35231912511 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Mar 16 20:27:38 2020 +0100 patch 8.2.0394: Coverity complains about using NULL pointer Problem: Coverity complains about using NULL pointer. Solution: Use empty string when option value is NULL.
author Bram Moolenaar <Bram@vim.org>
date Mon, 16 Mar 2020 20:30:04 +0100
parents 8ece63e7632a
children db11dd62388b
files src/optionstr.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -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,
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    394,
+/**/
     393,
 /**/
     392,