From c528824094028b13c26b339bfd8eb4a9ab35a30c Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Mon, 23 Feb 2026 10:04:45 +0100 Subject: [PATCH] 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. --- src/ncbmbuf.c | 2 ++ 1 file changed, 2 insertions(+) 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); -- 2.47.3