Skip to content

Commit d080986

Browse files
committed
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 <[email protected]>
1 parent 2f6efac commit d080986

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
812,
707709
/**/
708710
811,
709711
/**/

src/window.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7934,7 +7934,7 @@ check_colorcolumn(
79347934
char_u *cc, // when NULL: use "wp->w_p_cc"
79357935
win_T *wp) // when NULL: only parse "cc"
79367936
{
7937-
char_u *s;
7937+
char_u *s = empty_option;
79387938
int tw;
79397939
int col;
79407940
int count = 0;
@@ -7947,7 +7947,7 @@ check_colorcolumn(
79477947

79487948
if (cc != NULL)
79497949
s = cc;
7950-
else
7950+
else if (wp != NULL)
79517951
s = wp->w_p_cc;
79527952

79537953
if (wp != NULL)

0 commit comments

Comments
 (0)