Mercurial > vim
changeset 36384:9c1ea595da48 draft v9.1.0812
patch 9.1.0812: Coverity warns about dereferencing NULL ptr
Commit: https://github.com/vim/vim/commit/d0809869d6445faecd323fb33dc271d8c74a94fb
Author: Christian Brabandt <cb@256bit.org>
Date: Wed Oct 23 21:32:31 2024 +0200
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: #15914
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 23 Oct 2024 21:45:02 +0200 |
parents | 3e30814f0eee |
children | 66ab44af9b01 |
files | src/version.c src/window.c |
diffstat | 2 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 812, +/**/ 811, /**/ 810,
--- a/src/window.c +++ b/src/window.c @@ -7934,7 +7934,7 @@ check_colorcolumn( char_u *cc, // when NULL: use "wp->w_p_cc" win_T *wp) // when NULL: only parse "cc" { - char_u *s; + char_u *s = empty_option; int tw; int col; int count = 0; @@ -7947,7 +7947,7 @@ check_colorcolumn( if (cc != NULL) s = cc; - else + else if (wp != NULL) s = wp->w_p_cc; if (wp != NULL)