]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ncbuf: fix coverity warning on uninit sz_data
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 13 May 2022 13:33:50 +0000 (15:33 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 13 May 2022 15:06:24 +0000 (17:06 +0200)
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

index f7ee48913ff0ff129d0e62528ec82091e0a1e1b0..4012adcf45096519f7e880a003567f8e31099b49 100644 (file)
@@ -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);