commit a0ad35e3bbb3eac12dae031ea8bea00feb92a8ca
parent 6b63fe798b7481edd8e3b0ed75a33bf297ca2856
Author: zeertzjq <zeertzjq@outlook.com>
Date: Thu, 24 Oct 2024 06:39:15 +0800
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 <cb@256bit.org>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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;
}