changeset 31958:b08c410578a5 v9.0.1311

patch 9.0.1311: Coverity warns for using a NULL pointer Commit: https://github.com/vim/vim/commit/339e114d70de3ec2b36edf37d7ba7a7cfdf9d1a6 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 15 14:26:25 2023 +0000 patch 9.0.1311: Coverity warns for using a NULL pointer Problem: Coverity warns for using a NULL pointer. Solution: Use "empty_option" instead of NULL.
author Bram Moolenaar <Bram@vim.org>
date Wed, 15 Feb 2023 15:30:05 +0100
parents bf0a76d00c89
children 2d1c9f3615db
files src/option.c src/version.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/option.c
+++ b/src/option.c
@@ -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
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1311,
+/**/
     1310,
 /**/
     1309,