HomeFreeBSD

malloc_aligned() may not leave enough space for pointer to allocated memory,

Description

malloc_aligned() may not leave enough space for pointer to allocated memory,
saving the pointer will overwrite bytes belongs to another memory block
unexpectly, to fix the problem, use (allocated address + sizeof(void *)) as
initial value, and slip to next aligned address, so maximum extra bytes is
sizeof(void *) + align - 1.

Tested by: Andre Albsmeier < mail at ma17 dot ata dot myota dot orgndre >

Details

Provenance
davidxuAuthored on
Parents
rS262276: Move ^/user/gjb/hacking/release-embedded up one directory, and remove
Branches
Unknown
Tags
Unknown

Event Timeline