This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] correct aligned_alloc argument order (PR 80020)
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 13 Mar 2017 09:44:27 +0100
- Subject: Re: [PATCH] correct aligned_alloc argument order (PR 80020)
- Authentication-results: sourceware.org; auth=none
- References: <e08fee72-2089-ea49-5108-93e5833bd9ca@gmail.com>
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