Skip to content

Commit 2c42eb0

Browse files
authored
Make sure can frame is zero initialized
The structure can_frame_t, can be extended inside rt-kernel, and must zero initialized to avoid reads of uninitialized memory.
1 parent e43524e commit 2c42eb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ports/rt-kernel/coal_can.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ os_channel_t * os_channel_open (const char * name, void * callback, void * arg)
6565

6666
int os_channel_send (os_channel_t * channel, uint32_t id, const void * data, size_t dlc)
6767
{
68-
can_frame_t frame;
68+
can_frame_t frame = {};
6969

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

@@ -87,7 +87,7 @@ int os_channel_receive (
8787
void * data,
8888
size_t * dlc)
8989
{
90-
can_frame_t frame;
90+
can_frame_t frame = {};
9191
int result;
9292

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

0 commit comments

Comments
 (0)