commit 4d7a8b47b96927f475634c3116ced06acbb600b5
parent a093c66bcd5c7aadd7073cb88695328bcf15360f
Author: Lewis Russell <lewis6991@gmail.com>
Date: Sat, 22 Apr 2023 08:51:02 +0100
vim-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.
https://github.com/vim/vim/commit/339e114d70de3ec2b36edf37d7ba7a7cfdf9d1a6
N/A patches for version.c:
vim-patch:9.0.1405: missing check for out-of-memory
Problem: Missing check for out-of-memory.
Solution: Check for alloc() returning NULL pointer. (closes vim/vim#12149)
https://github.com/vim/vim/commit/14338024c131b71a337c2bb87cb5904f5a5782b8
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/nvim/option.c b/src/nvim/option.c
@@ -1207,6 +1207,9 @@ static void do_set_option_string(int opt_idx, int opt_flags, char **argp, int ne
// Set the new value.
*(char **)(varp) = newval;
+ if (newval == NULL) {
+ *(char **)(varp) = empty_option;
+ }
// origval may be freed by did_set_string_option(), make a copy.
char *saved_origval = (origval != NULL) ? xstrdup(origval) : NULL;