summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-03-16 20:27:38 +0100
committerBram Moolenaar <Bram@vim.org>2020-03-16 20:27:38 +0100
commit7f009dfa064240d9024b76212535a35231912511 (patch)
treed63e1265b93f65f405c08df6500e915776e7cc57
parentc0300633292ee648c7154a7828eb1c76637bd9af (diff)
downloadvim-git-8.2.0394.tar.gz
patch 8.2.0394: Coverity complains about using NULL pointerv8.2.0394
Problem: Coverity complains about using NULL pointer. Solution: Use empty string when option value is NULL.
-rw-r--r--src/optionstr.c2
-rw-r--r--src/version.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/optionstr.c b/src/optionstr.c
index af4b749f2..1cf1ee9df 100644
--- 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,
diff --git a/src/version.c b/src/version.c
index b0497a52c..717ca669e 100644
--- 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,