master: Build failure in malloc with GCC 7
Zack Weinberg
zackw@panix.com
Wed Jul 12 14:29:00 GMT 2017
On Wed, Jul 12, 2017 at 10:27 AM, Zack Weinberg <zackw@panix.com> wrote:
> + impossible for global_max_fast to become larger than than
Or without the double 'than',
+static inline INTERNAL_SIZE_T
+get_max_fast (void)
+{
+ /* If this function ever returns a value larger than MAX_FAST_SIZE,
+ _int_malloc will make out-of-bounds array accesses. It should be
+ impossible for global_max_fast to become larger than MAX_FAST_SIZE,
+ but as an extra precaution, limit the value here as well. */
+ if (global_max_fast > MAX_FAST_SIZE)
+ return MAX_FAST_SIZE;
+ return global_max_fast;
+}
More information about the Libc-alpha
mailing list