This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: master: Build failure in malloc with GCC 7


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;
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]