mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-16 08:24:42 +00:00
MINOR: memory: also poison the area on freeing
Doing so sometimes helps detect some UAF situations without the overhead associated to the DEBUG_UAF define.
This commit is contained in:
parent
5de7817ae8
commit
da52035a45
@ -332,6 +332,8 @@ static inline void pool_free(struct pool_head *pool, void *ptr)
|
||||
if (*POOL_LINK(pool, ptr) != (void *)pool)
|
||||
*(volatile int *)0 = 0;
|
||||
#endif
|
||||
if (mem_poison_byte >= 0)
|
||||
memset(ptr, mem_poison_byte, pool->size);
|
||||
pool_put_to_cache(pool, ptr);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user