From: Bram Moolenaar Date: Mon, 19 Jun 2017 18:35:32 +0000 (+0200) Subject: patch 8.0.0648: possible use of NULL pointer X-Git-Tag: v8.0.0648 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fadacf01d0dbcc7a96ef5eee0ad57956eeab04d7;p=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(). --- 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 @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 648, /**/ 647, /**/