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: OndÅej BÃlka <neleai at seznam dot cz>
- To: Will Newton <will dot newton at linaro dot org>
- Cc: libc-alpha at sourceware dot org, Patch Tracking <patches at linaro dot org>
- Date: Fri, 11 Oct 2013 15:33:56 +0200
- 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>
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?