diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-06-19 20:35:32 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-06-19 20:35:32 +0200 |
commit | fadacf01d0dbcc7a96ef5eee0ad57956eeab04d7 (patch) | |
tree | 42f8ae1fbc4012428053b24af455b7dc1c983643 | |
parent | 06f1ed2f78c5c03af95054fc3a8665df39dec362 (diff) | |
download | vim-fadacf01d0dbcc7a96ef5eee0ad57956eeab04d7.zip |
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().
-rw-r--r-- | src/buffer.c | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 3 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; } diff --git a/src/version.c b/src/version.c index 59f0d0977..b221ce259 100644 --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 648, +/**/ 647, /**/ 646, |