diff options
Diffstat (limited to 'tests/common.c')
-rw-r--r-- | tests/common.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/common.c b/tests/common.c index 247d8f3d..882c266a 100644 --- a/tests/common.c +++ b/tests/common.c @@ -14,12 +14,12 @@ bool can_frame_was_sent; bool message_was_received; uint16_t last_message_received_arb_id; -uint8_t* last_message_received_payload; +uint8_t last_message_received_payload[OUR_MAX_ISO_TP_MESSAGE_SIZE]; uint8_t last_message_received_payload_size; uint16_t last_message_sent_arb_id; bool last_message_sent_status; -uint8_t* last_message_sent_payload; +uint8_t last_message_sent_payload[OUR_MAX_ISO_TP_MESSAGE_SIZE]; uint8_t last_message_sent_payload_size; void debug(const char* format, ...) { @@ -84,8 +84,8 @@ void can_frame_sent(const uint16_t arbitration_id, const uint8_t* payload, void setup() { SHIMS = isotp_init_shims(debug, mock_send_can, mock_set_timer); HANDLE = isotp_receive(&SHIMS, 0x2a, message_received); - last_message_sent_payload = malloc(MAX_ISO_TP_MESSAGE_SIZE); - last_message_received_payload = malloc(MAX_ISO_TP_MESSAGE_SIZE); + memset(last_message_sent_payload, 0, OUR_MAX_ISO_TP_MESSAGE_SIZE); + memset(last_message_received_payload, 0, OUR_MAX_ISO_TP_MESSAGE_SIZE); memset(last_can_payload_sent, 0, sizeof(last_can_payload_sent)); last_message_sent_status = false; message_was_received = false; |