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.
This commit is contained in:
Amaury Denoyelle 2022-05-13 15:33:50 +02:00
parent 26f221bd55
commit b5ca943ff9

View File

@ -131,6 +131,7 @@ static struct ncb_blk ncb_blk_first(const struct ncbuf *buf)
blk.sz_ptr = ncb_reserved(buf); blk.sz_ptr = ncb_reserved(buf);
blk.sz = ncb_read_off(buf, ncb_reserved(buf)); blk.sz = ncb_read_off(buf, ncb_reserved(buf));
blk.sz_data = 0;
BUG_ON_HOT(blk.sz > ncb_size(buf)); BUG_ON_HOT(blk.sz > ncb_size(buf));
blk.end = ncb_peek(buf, blk.sz); blk.end = ncb_peek(buf, blk.sz);