aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-06-21 10:36:52 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-06-21 12:50:31 -0400
commit10083ec4cc6d8f03831445831a20c82fee87880b (patch)
tree699f705b09fc56af06ac155fb95e10675fefa526
parentbf61885cb45fcced4f5886f336460be4af8a8ba8 (diff)
downloadrneovim-10083ec4cc6d8f03831445831a20c82fee87880b.tar.gz
rneovim-10083ec4cc6d8f03831445831a20c82fee87880b.tar.bz2
rneovim-10083ec4cc6d8f03831445831a20c82fee87880b.zip
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(). https://github.com/vim/vim/commit/fadacf01d0dbcc7a96ef5eee0ad57956eeab04d7
-rw-r--r--src/nvim/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index a113cbcd5f..ea2ae016b9 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -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;
}