mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-27 03:33:33 +08:00
malloc: Switch global_max_fast to uint8_t
MAX_FAST_SIZE is 160 at most, so a uint8_t is sufficient. This makes it harder to use memory corruption, by overwriting global_max_fast with a large value, to fundamentally alter malloc behavior. Reviewed-by: DJ Delorie <dj@redhat.com>
This commit is contained in:
parent
ba0ca36132
commit
15a94e6668
@ -1757,7 +1757,7 @@ typedef struct malloc_chunk *mfastbinptr;
|
|||||||
#define set_contiguous(M) ((M)->flags &= ~NONCONTIGUOUS_BIT)
|
#define set_contiguous(M) ((M)->flags &= ~NONCONTIGUOUS_BIT)
|
||||||
|
|
||||||
/* Maximum size of memory handled in fastbins. */
|
/* Maximum size of memory handled in fastbins. */
|
||||||
static INTERNAL_SIZE_T global_max_fast;
|
static uint8_t global_max_fast;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Set value of max_fast.
|
Set value of max_fast.
|
||||||
|
Loading…
Reference in New Issue
Block a user