src: suppress false positives for cppcheck 2.10

This commit is contained in:
Matthias Ringwald 2023-05-23 22:20:37 +02:00
parent 806089a7cc
commit d552970049
3 changed files with 5 additions and 0 deletions

View File

@ -2720,6 +2720,7 @@ static gatt_client_t * gatt_client_get_context_for_l2cap_cid(uint16_t l2cap_cid)
static void gatt_client_classic_handle_connected(gatt_client_t * gatt_client, uint8_t status){ static void gatt_client_classic_handle_connected(gatt_client_t * gatt_client, uint8_t status){
bd_addr_t addr; bd_addr_t addr;
// cppcheck-suppress uninitvar ; addr is reported as uninitialized although it's the destination of the memcpy
memcpy(addr, gatt_client->addr, 6); memcpy(addr, gatt_client->addr, 6);
hci_con_handle_t con_handle = gatt_client->con_handle; hci_con_handle_t con_handle = gatt_client->con_handle;
btstack_packet_handler_t callback = gatt_client->callback; btstack_packet_handler_t callback = gatt_client->callback;

View File

@ -604,6 +604,7 @@ static void sm_reencryption_started(sm_connection_t * sm_conn){
} else { } else {
// for legacy pairing with LTK re-construction, use current peer addr // for legacy pairing with LTK re-construction, use current peer addr
identity_addr_type = sm_conn->sm_peer_addr_type; identity_addr_type = sm_conn->sm_peer_addr_type;
// cppcheck-suppress uninitvar ; identity_addr is reported as uninitialized although it's the destination of the memcpy
memcpy(identity_addr, sm_conn->sm_peer_address, 6); memcpy(identity_addr, sm_conn->sm_peer_address, 6);
} }
@ -624,6 +625,7 @@ static void sm_reencryption_complete(sm_connection_t * sm_conn, uint8_t status){
} else { } else {
// for legacy pairing with LTK re-construction, use current peer addr // for legacy pairing with LTK re-construction, use current peer addr
identity_addr_type = sm_conn->sm_peer_addr_type; identity_addr_type = sm_conn->sm_peer_addr_type;
// cppcheck-suppress uninitvar ; identity_addr is reported as uninitialized although it's the destination of the memcpy
memcpy(identity_addr, sm_conn->sm_peer_address, 6); memcpy(identity_addr, sm_conn->sm_peer_address, 6);
} }
@ -779,6 +781,7 @@ static void sm_c1_t3(sm_key_t t2, bd_addr_t ia, bd_addr_t ra, uint8_t * t3){
// 0xB1B2B3B4B5B6 then p2 is 0x00000000A1A2A3A4A5A6B1B2B3B4B5B6. // 0xB1B2B3B4B5B6 then p2 is 0x00000000A1A2A3A4A5A6B1B2B3B4B5B6.
sm_key_t p2; sm_key_t p2;
// cppcheck-suppress uninitvar ; p2 is reported as uninitialized
memset(p2, 0, 16); memset(p2, 0, 16);
(void)memcpy(&p2[4], ia, 6); (void)memcpy(&p2[4], ia, 6);
(void)memcpy(&p2[10], ra, 6); (void)memcpy(&p2[10], ra, 6);

View File

@ -730,6 +730,7 @@ static void hfp_handle_slc_setup_error(hfp_connection_t * hfp_connection, uint8_
// cache fields for event // cache fields for event
hfp_role_t local_role = hfp_connection->local_role; hfp_role_t local_role = hfp_connection->local_role;
bd_addr_t remote_addr; bd_addr_t remote_addr;
// cppcheck-suppress uninitvar ; remote_addr is reported as uninitialized although it's the destination of the memcpy
(void)memcpy(remote_addr, hfp_connection->remote_addr, 6); (void)memcpy(remote_addr, hfp_connection->remote_addr, 6);
// finalize connection struct // finalize connection struct
hfp_finalize_connection_context(hfp_connection); hfp_finalize_connection_context(hfp_connection);