]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: pools: fix crash on filtered "show pools" output
authorWilly Tarreau <w@1wt.eu>
Thu, 16 Oct 2025 06:27:44 +0000 (08:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 16 Oct 2025 06:41:32 +0000 (08:41 +0200)
commitab0c97139f29e8f2498da03e0ae6339402a08f12
tree012720265135249a5993f3698ceb5755df68f199
parentd5f4872ba627b3e19d1f107f2febe9b669be033f
BUG/MEDIUM: pools: fix crash on filtered "show pools" output

The truncation of pools output that was adressed in commit 982805e6a3
("BUG/MINOR: pools: Fix the dump of pools info to deal with buffers
limitations") required to split the pools filling from dumping. However
there is a problem when a limit is passed that is lower than the number
of pools or if a pool name is specified or if pool caches are disabled,
because in this case the number of filled slots will be lower than the
initially allocated one, and empty entries will be visited either by the
sort functions when filling the entries if "byxxx" is specified, or by
the dump function after the last entry, but none of these functions was
expecting to be passed a NULL entry.

Let's just re-adjust nbpools to match the number of filled entries at
the end. Anyway the totals are calculated on the number of dumped
entries.

This must be backported to 3.2 since the fix above was backported there
as well.
src/pool.c