[Bug target/94158] Expanded strlen causes out-of-bounds read on AMD64 target

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 12 22:26:42 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94158

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> (In reply to Parker Thompson from comment #3)
> > As for alloc alignment, glibc strdup() does not use aligned_alloc, just
> > malloc.  Which by my read of the spec does not guarantee alignment.
> 
> malloc requires alignement of alignof(max_align_t) (definition in the newest
> C and C++ standards) but beforehand it was required to be aligned enough to
> support all standard types.

C11 is where the definition changes to use max_align_t.

https://en.cppreference.com/w/c/types/max_align_t


More information about the Gcc-bugs mailing list