Skip to content

Commit

Permalink
patch 8.0.0648: possible use of NULL pointer
Browse files Browse the repository at this point in the history
Problem:    Possible use of NULL pointer if buflist_new() returns NULL.
            (Coverity)
Solution:   Check for NULL pointer in set_bufref().
  • Loading branch information
brammool committed Jun 19, 2017
1 parent 06f1ed2 commit fadacf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/buffer.c
Expand Up @@ -372,7 +372,7 @@ open_buffer(
set_bufref(bufref_T *bufref, buf_T *buf) set_bufref(bufref_T *bufref, buf_T *buf)
{ {
bufref->br_buf = buf; bufref->br_buf = buf;
bufref->br_fnum = buf->b_fnum; bufref->br_fnum = buf == NULL ? 0 : buf->b_fnum;
bufref->br_buf_free_count = buf_free_count; bufref->br_buf_free_count = buf_free_count;
} }


Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -764,6 +764,8 @@ static char *(features[]) =


static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
648,
/**/ /**/
647, 647,
/**/ /**/
Expand Down

0 comments on commit fadacf0

Please sign in to comment.