From: Amaury Denoyelle Date: Mon, 23 Feb 2026 09:04:45 +0000 (+0100) Subject: MINOR: ncbmbuf: improve itbmap_next() code X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c528824094028b13c26b339bfd8eb4a9ab35a30c;p=thirdparty%2Fhaproxy.git MINOR: ncbmbuf: improve itbmap_next() code itbmap_next() advances an iterator over a ncbmbuf buffer storage. When reaching the end of the buffer, field is set to NULL, and the caller is expected to stop working with the iterator. Complete this part to ensure that itbmap type is fully initialized in case null iterator value is returned. This is not strictly required given the above description, but this is better to avoid any possible future mistake. This should fix coverity issue from github #3273. This could be backported up to 2.8. --- diff --git a/src/ncbmbuf.c b/src/ncbmbuf.c index 6f66e9cae..222737ea6 100644 --- a/src/ncbmbuf.c +++ b/src/ncbmbuf.c @@ -143,6 +143,8 @@ static struct itbmap itbmap_next(const struct ncbmbuf *buf, if (off_next == ncbmb_size(buf)) { next.b = NULL; next.off = off_next; + next.mask = 0; + next.bits = 0; } else { itbmap_load(&next, prev->off + prev->bits, buf);