]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: chunk: add a BUG_ON upon the next init_trash_buffer()
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 15 Nov 2024 16:15:06 +0000 (17:15 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 15 Nov 2024 16:15:06 +0000 (17:15 +0100)
commit0bfd36e7b80afd9b2e815d83b853312c8fe64ad6
tree4e4780067e6edb0e00bd4ee93ff4a190f1ac84da
parent5f37af7a8efe2fc97c4ecbc17b7710860d893b28
MINOR: chunk: add a BUG_ON upon the next init_trash_buffer()

The trash pool is initialized twice in haproxy, first during STG_POOL,
and 2nd after configuration parsing.

Doing alloc_trash_chunk() between this 2 phases can lead to strange
things if we are using it after, indeed the pool is destroyed and
trying to do a free_trash_chunk() or accessing the pointer will lead to
crashes.

This patch checks that we don't have used buffers from the trash pool
before initializing the pool again.
src/chunk.c