Skip to content

Commit fadacf0

Browse files
committed
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().
1 parent 06f1ed2 commit fadacf0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ open_buffer(
372372
set_bufref(bufref_T *bufref, buf_T *buf)
373373
{
374374
bufref->br_buf = buf;
375-
bufref->br_fnum = buf->b_fnum;
375+
bufref->br_fnum = buf == NULL ? 0 : buf->b_fnum;
376376
bufref->br_buf_free_count = buf_free_count;
377377
}
378378

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
648,
767769
/**/
768770
647,
769771
/**/

0 commit comments

Comments
 (0)