forked from jmckaskill/c-capnproto
-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Milestone
Description
In the function capn_write_mem_packed in capn-malloc.c the uint32_t pointer "header" is calculated.
The function gets a 32 bit aligend pointer to the payload buffer passed.
"header" has an offset to the payload buffer pointer of header size + 2 bytes. Depending on header size it can happen that "header" is not aligned to 32 bit.
Subsequently header_render() performs 32 bit write access to the unaligned "header" pointer.
Processor which can't perform unaligned 32 bit access went to hard fault/memory fault.
As a walk around it is possible to write the data to be written in a variable and copy the variable to the pointer with memcpy.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels