AP_Periph: check decode for DNA message

This commit is contained in:
Andrew Tridgell 2024-02-11 09:07:00 +11:00
parent e59d432281
commit 50332ab23f
1 changed files with 4 additions and 1 deletions

View File

@ -434,7 +434,10 @@ void AP_Periph_FW::handle_allocation_response(CanardInstance* canard_instance, C
// Copying the unique ID from the message
uavcan_protocol_dynamic_node_id_Allocation msg;
uavcan_protocol_dynamic_node_id_Allocation_decode(transfer, &msg);
if (uavcan_protocol_dynamic_node_id_Allocation_decode(transfer, &msg)) {
// failed decode
return;
}
// Obtaining the local unique ID
uint8_t my_unique_id[sizeof(msg.unique_id.data)];