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

d0809869d6

Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2024-10-24 06:39:15 +08:00
parent 6b63fe798b
commit a0ad35e3bb

View File

@ -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;
}