mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-28 04:12:17 -04:00
MINOR: pools: Cast to volatile int * instead of int *.
When using DEBUG_MEMORY_POOLS, when we want to crash, instead of using *(int *)0 = 0, use *(volatile int *)0 = 0, or clang will just translate it to a nop, instead of dereferencing 0.
This commit is contained in:
parent
efef323783
commit
51e474136b
1 changed files with 1 additions and 1 deletions
|
|
@ -475,7 +475,7 @@ static inline void pool_free(struct pool_head *pool, void *ptr)
|
|||
#ifdef DEBUG_MEMORY_POOLS
|
||||
/* we'll get late corruption if we refill to the wrong pool or double-free */
|
||||
if (*POOL_LINK(pool, ptr) != (void *)pool)
|
||||
*(int *)0 = 0;
|
||||
*(volatile int *)0 = 0;
|
||||
#endif
|
||||
|
||||
#ifndef DEBUG_UAF /* normal pool behaviour */
|
||||
|
|
|
|||
Loading…
Reference in a new issue