mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-20 21:31:28 +02:00
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.
This commit is contained in:
parent
b662c5d2b8
commit
3ef7daa731
@ -201,7 +201,7 @@ struct ring *startup_logs_dup(struct ring *src)
|
||||
struct ring *dst = NULL;
|
||||
|
||||
/* must use the size of the previous buffer */
|
||||
dst = ring_new(ring_size(src));
|
||||
dst = ring_new(ring_allocated_size(src));
|
||||
if (!dst)
|
||||
goto error;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user