]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: ring: use the correct size to reallocate startup_logs
authorWilly Tarreau <w@1wt.eu>
Mon, 15 Apr 2024 06:26:41 +0000 (08:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 15 Apr 2024 06:26:41 +0000 (08:26 +0200)
commit3ef7daa73169fc0d72b60e79ac6782d903dd6d4e
treed103ccf425038efba82aa4e5b64a950adfa83a67
parentb662c5d2b887dc6e97d50e9706d17bc6ece75105
BUG/MAJOR: ring: use the correct size to reallocate startup_logs

In 3.0-dev, with commit 7c9ce715c9 ("MINOR: ring: make callers use
ring_data() and ring_size(), not ring->buf"), we made startup_logs_dup()
use ring_size() to get the old ring size and pass it to ring_new() to
create a new ring. But due to the ambiguity of the allocate vs usable
size, this resulted in slightly shrinking the buffer compared to the
previous one, occasionally causing crashes if the first one was already
full of warnings, as seen in GH issue #2529. We need to use the allocated
size instead, thanks to the function brought by previous commit.

No backport is needed, this only affects 3.0-dev. Thanks to @felipewd
for the detailed report that allowed to spot the problem.
src/errors.c