On Sat, Nov 28, 2026 at 11:11:55AM +0000, Mileto, A. (Alessandro) wrote: > ## 3. readelf: `free_filedata()` clears the rest of `Filedata` through > `&filedata->section_headers` > Short: `memset (&filedata->section_headers, 0, sizeof (Filedata) - offsetof > (Filedata, > section_headers));` clears every member from `section_headers` to the end of > the (heap) `Filedata` > through a pointer to `section_headers`, an 8-byte member. This one is > informative: the memset clears > exactly the memory it means to, but a pointer to a member covers that member > only, so the write past > it is undefined behavior.
Where in the ISO C99 standard does it say this is undefined behaviour? -- Alan Modra
