Skip to content

Commit

Permalink
Make sure can frame is zero initialized
Browse files Browse the repository at this point in the history
The structure can_frame_t, can be extended inside rt-kernel, and must zero initialized to avoid reads of uninitialized memory.
  • Loading branch information
elupus authored and hefloryd committed Nov 30, 2023
1 parent e43524e commit d78cccc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ports/rt-kernel/coal_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ os_channel_t * os_channel_open (const char * name, void * callback, void * arg)

int os_channel_send (os_channel_t * channel, uint32_t id, const void * data, size_t dlc)
{
can_frame_t frame;
can_frame_t frame = {};

co_msg_log ("Tx", id, data, dlc);

Expand All @@ -87,7 +87,7 @@ int os_channel_receive (
void * data,
size_t * dlc)
{
can_frame_t frame;
can_frame_t frame = {};
int result;

result = can_receive (channel->handle, &frame);
Expand Down

0 comments on commit d78cccc

Please sign in to comment.