mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-12-18 20:34:22 -05:00
support random quarantine sizes other than 0 or 16
This commit is contained in:
parent
418cb1609c
commit
5d3b299209
@ -591,7 +591,7 @@ static inline void deallocate_small(void *p, const size_t *expected_size) {
|
|||||||
set_quarantine(metadata, slot);
|
set_quarantine(metadata, slot);
|
||||||
|
|
||||||
#if SLAB_QUARANTINE_RANDOM_SIZE > 0
|
#if SLAB_QUARANTINE_RANDOM_SIZE > 0
|
||||||
size_t random_index = get_random_u16_uniform(&c->rng, 16);
|
size_t random_index = get_random_u16_uniform(&c->rng, SLAB_QUARANTINE_RANDOM_SIZE);
|
||||||
void *substitute = c->quarantine_random[random_index];
|
void *substitute = c->quarantine_random[random_index];
|
||||||
c->quarantine_random[random_index] = p;
|
c->quarantine_random[random_index] = p;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user