This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH v3] malloc: make malloc fail with requests larger than PTRDIFF_MAX (BZ#23741)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 17 Apr 2019 21:33:41 +0000
- Subject: Re: [PATCH v3] malloc: make malloc fail with requests larger than PTRDIFF_MAX (BZ#23741)
- References: <email@example.com>
On Tue, 9 Apr 2019, Adhemerval Zanella wrote:
> As discussed previously on libc-alpha , this patch follows up the idea
> and add both the __attribute_alloc_size__ on malloc functions (malloc,
> calloc, realloc, reallocarray, valloc, pvalloc, memaling, and
> posix_memalign) and limit maximum requested allocation size to up
> PTRDIFF_MAX (taking into consideration internal padding and alignment).
__attribute_alloc_size__ is for functions that return a pointer. That is,
it *cannot* be applied to posix_memalign (see remarks in
This is an issue with the proposed commit message and ChangeLog entry, not
the patch itself which doesn't appear to apply the attribute to
posix_memalign after all. The commit message should discuss why the
attribute is not applied to posix_memalign, and the ChangeLog entry should
not say it's being applied there.
Joseph S. Myers