Skip to content

potential memory corruption due to size miscomputation upton custom region alloc init #320

Description

@magenbluten

here we allocate a fresh region with a user provided size value:

struct regional* r = (struct regional*)malloc(size);

this size value gets aligned to the neccessary alignment requirements. but this happens after the malloc. thus size
can now be larger than what was actually allocated:

size = ALIGN_UP(size, ALIGNMENT);

r->first_size = size;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions