From: Florian Weimer Date: Thu, 13 Oct 2022 03:45:41 +0000 (+0200) Subject: malloc: Switch global_max_fast to uint8_t X-Git-Tag: glibc-2.37~260 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=15a94e6668a6d7c5697e805d8d67f1d102d0d52e;p=thirdparty%2Fglibc.git 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 --- diff --git a/malloc/malloc.c b/malloc/malloc.c index 953183e9567..2a61c8b5ee3 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -1757,7 +1757,7 @@ typedef struct malloc_chunk *mfastbinptr; #define set_contiguous(M) ((M)->flags &= ~NONCONTIGUOUS_BIT) /* 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.