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().
diff --git a/src/buffer.c b/src/buffer.c
index 2f574e0..e8e1a6d 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -372,7 +372,7 @@
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 59f0d09..b221ce2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 648,
+/**/
647,
/**/
646,