This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [PATCH] correct aligned_alloc argument order (PR 80020)


On Mon, Mar 13, 2017 at 2:13 AM, Martin Sebor <msebor@gmail.com> wrote:
> r243470 decorates standard allocation functions like alloca
> and malloc with attribute alloc_size.  However, in applying
> the attribute to aligned_alloc I had overlooked that the size
> argument is the second one and not the first.  That oversight
> has led to __builtin_object_size() reporting the wrong size
> for aligned_alloc-allocated objects and, consequently, to
> checking functions like __memset_chk calling abort for buffer
> bogus overflows.
>
> The attached patch corrects this mistake by decorating the
> function with the correct alloc_size attribute.

Ok.

Richard.

> Martin


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