-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
There lurks a potentially nasty bug in the example in the toplevel Readme
Lines 148 to 149 in 7fe06a3
| Avtp_Lin_t lin; | |
| uint8_t linPayload[LIN_PAYLOAD_LEN]; |
C standard does not guarantee that uint8_t linPayload[LIN_PAYLOAD_LEN]; follows in memory after Avtp_Lin_t lin; there might be gaps in between due to alignment. Thus the memcpy in the end may copy an invalid frame.
I think either we change the example using a more robust pattern, or at least warn about this (there are some non-standard tags in some compilers to force it to create packed structs)
Metadata
Metadata
Assignees
Labels
No labels