[PATCH] malloc: Fix for infinite loop in memalign/posix_memalign.

Will Newton will.newton@linaro.org
Fri Oct 11 13:46:00 GMT 2013


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



More information about the Libc-alpha mailing list