mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 12:41:00 +02:00
MINOR: ncbmbuf: improve itbmap_next() code
itbmap_next() advances an iterator over a ncbmbuf buffer storage. When reaching the end of the buffer, <b> 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.
This commit is contained in:
parent
868dd3e88b
commit
c528824094
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user