diff --git a/src/can_buffer.c b/src/can_buffer.c --- a/src/can_buffer.c +++ b/src/can_buffer.c @@ -20,7 +20,7 @@ CanBufferStatus can_buffer_add(volatile volatile CanRxMsgTypeDef* can_buffer_remove(volatile CanBuffer *buffer) { - volatile CanRxMsgTypeDef* msg; + volatile CanRxMsgTypeDef* msg = NULL; if (buffer->count > 0) { msg = &buffer->data[buffer->tail]; buffer->tail = (buffer->tail + 1) % CAN_BUFFER_SIZE;