]> granicus.if.org Git - vim/commitdiff
patch 9.0.1311: Coverity warns for using a NULL pointer v9.0.1311
authorBram Moolenaar <Bram@vim.org>
Wed, 15 Feb 2023 14:26:25 +0000 (14:26 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 15 Feb 2023 14:26:25 +0000 (14:26 +0000)
Problem:    Coverity warns for using a NULL pointer.
Solution:   Use "empty_option" instead of NULL.

src/option.c
src/version.c

index 717812c9ceffc36fa193ee307963fbd7135562ff..1b581ed355bdaaf917c30972a8f31b220db5302d 100644 (file)
@@ -1990,6 +1990,8 @@ do_set_option_string(
 
     // Set the new value.
     *(char_u **)(varp) = newval;
+    if (newval == NULL)
+       *(char_u **)(varp) = empty_option;
 
 #if defined(FEAT_EVAL)
     if (!starting
index a6451cb6a134b8cd04d393dc922e6e907349f0fd..c59a3a1df4b9eedbb88f60ce1c3a16b55732a845 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1311,
 /**/
     1310,
 /**/