From a0ad35e3bbb3eac12dae031ea8bea00feb92a8ca Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 24 Oct 2024 06:39:15 +0800 Subject: vim-patch:9.1.0812: Coverity warns about dereferencing NULL ptr Problem: Coverity warns about dereferencing NULL ptr in check_colorcolumn() Solution: verify that wp is not null before accessing it related: vim/vim#15914 https://github.com/vim/vim/commit/d0809869d6445faecd323fb33dc271d8c74a94fb Co-authored-by: Christian Brabandt --- src/nvim/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/window.c b/src/nvim/window.c index 73d31d3048..5147bbd23b 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -7384,10 +7384,10 @@ const char *check_colorcolumn(char *cc, win_T *wp) return NULL; // buffer was closed } - char *s; + char *s = empty_string_option; if (cc != NULL) { s = cc; - } else { + } else if (wp != NULL) { s = wp->w_p_cc; } -- cgit