You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
There lurks a potentially nasty bug in the example in the toplevel Readme
Open1722/README.md
Lines 148 to 149 in 7fe06a3
C standard does not guarantee that
uint8_t linPayload[LIN_PAYLOAD_LEN];
follows in memory afterAvtp_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)
The text was updated successfully, but these errors were encountered: