This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] malloc: Fix for infinite loop in memalign/posix_memalign.
- From: Will Newton <will dot newton at linaro dot org>
- To: Ondřej Bílka <neleai at seznam dot cz>
- Cc: libc-alpha <libc-alpha at sourceware dot org>, Patch Tracking <patches at linaro dot org>
- Date: Fri, 11 Oct 2013 14:46:02 +0100
- Subject: Re: [PATCH] malloc: Fix for infinite loop in memalign/posix_memalign.
- Authentication-results: sourceware.org; auth=none
- References: <52569CED dot 3060700 at linaro dot org> <20131011133356 dot GB18534 at domone dot podge>
On 11 October 2013 14:33, OndÅej BÃlka <neleai@seznam.cz> wrote:
> On Thu, Oct 10, 2013 at 01:26:21PM +0100, Will Newton wrote:
>> +
>> + /* Test to expose integer overflow in malloc internals from BZ #16038. */
>> + p = memalign (-1, pagesize);
>> +
>> + save = errno;
>> +
>> + if (p != NULL)
>> + merror ("memalign (-1, pagesize) succeeded.");
>> +
>> + if (p == NULL && save != EINVAL)
>> + merror ("memalign (-1, -pagesize) errno is not set correctly");
>> +
> Why are you switching between pagesize and -pagesize?
Thanks for spotting the typo, fixed.
--
Will Newton
Toolchain Working Group, Linaro