Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/acf-can/acf-can-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,12 @@ int avtp_to_can(uint8_t *pdu, frame_t *can_frames, bool can_fd, int use_udp, uin
}
frame_t *frame = &(can_frames[i]);

/* The frame array is reused across AVTPDUs and the flag handling
* below only ever sets bits, so clear the slot first. Otherwise
* FDF, BRS, or ESI left over from an earlier frame in the same
* slot would leak onto a later classic frame that never set them. */
memset(frame, 0, sizeof(*frame));

// Handle EFF Flag
if (AVTP_CAN(IsEff)((AVTP_CAN(t) *)acf_pdu)) {
can_id |= CAN_EFF_FLAG;
Expand Down
Loading