]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: debug/pools: properly handle out-of-memory when building with DEBUG_UAF
authorWilly Tarreau <w@1wt.eu>
Thu, 22 Feb 2018 10:39:23 +0000 (11:39 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 Feb 2018 13:18:45 +0000 (14:18 +0100)
commit5a9cce46531ceea9fa4338c064e90f7a514b0ce1
tree6c0ee64fca4dff82c2c6473be69137974de10097
parentf161d0f51e7f073f249319417a5b869a6177072e
BUG/MINOR: debug/pools: properly handle out-of-memory when building with DEBUG_UAF

Commit 158fa75 ("MINOR: pools: implement DEBUG_UAF to detect use after free")
implemented pool use-after-free detection, but the mmap() return value isn't
properly checked, preventing the call to pool_alloc_area() from returning
NULL. So on out-of-memory a mangled pointer is returned, causing a crash on
the pool_alloc() site instead of forcing a GC. It doesn't affect regular
operations however, just complicates complex bug investigations.

This fix should be backported to 1.8 and to 1.7.
include/common/memory.h