From b5ca943ff9980c4272b8f6793130c49d9ac7493d Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Fri, 13 May 2022 15:33:50 +0200 Subject: [PATCH] BUG/MINOR: ncbuf: fix coverity warning on uninit sz_data Coverity reports that data block generated by ncb_blk_first() has sz_data field uninitialized. This has no real impact as it has no sense for data block. Set to 0 to hide the warning. This should fix github issue #1695. --- src/ncbuf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ncbuf.c b/src/ncbuf.c index f7ee48913..4012adcf4 100644 --- a/src/ncbuf.c +++ b/src/ncbuf.c @@ -131,6 +131,7 @@ static struct ncb_blk ncb_blk_first(const struct ncbuf *buf) blk.sz_ptr = ncb_reserved(buf); blk.sz = ncb_read_off(buf, ncb_reserved(buf)); + blk.sz_data = 0; BUG_ON_HOT(blk.sz > ncb_size(buf)); blk.end = ncb_peek(buf, blk.sz);