summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-19 20:35:32 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-19 20:35:32 +0200
commitfadacf01d0dbcc7a96ef5eee0ad57956eeab04d7 (patch)
tree42f8ae1fbc4012428053b24af455b7dc1c983643 /src/buffer.c
parent06f1ed2f78c5c03af95054fc3a8665df39dec362 (diff)
downloadvim-git-fadacf01d0dbcc7a96ef5eee0ad57956eeab04d7.tar.gz
patch 8.0.0648: possible use of NULL pointerv8.0.0648
Problem: Possible use of NULL pointer if buflist_new() returns NULL. (Coverity) Solution: Check for NULL pointer in set_bufref().
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 2f574e03d..e8e1a6de0 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -372,7 +372,7 @@ open_buffer(
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;
}