vim-patch:8.0.0648: possible use of NULL pointer

Problem:    Possible use of NULL pointer if buflist_new() returns NULL.
            (Coverity)
Solution:   Check for NULL pointer in set_bufref().
fadacf01d0
This commit is contained in:
Jan Edmund Lazo
2018-06-21 10:36:52 -04:00
parent bf61885cb4
commit 10083ec4cc

View File

@@ -343,7 +343,7 @@ open_buffer (
void set_bufref(bufref_T *bufref, buf_T *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;
}