mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
fix(bt/bluedroid): fix crash during bredr inquiry when zero-addr device is found
This commit is contained in:
@@ -778,7 +778,8 @@ void BTM_ReadDevInfo (BD_ADDR remote_bda, tBT_DEVICE_TYPE *p_dev_type, tBLE_ADDR
|
|||||||
memcmp(p_dev_rec->ble.pseudo_addr, remote_bda, BD_ADDR_LEN) == 0) {
|
memcmp(p_dev_rec->ble.pseudo_addr, remote_bda, BD_ADDR_LEN) == 0) {
|
||||||
*p_dev_type = p_dev_rec->device_type;
|
*p_dev_type = p_dev_rec->device_type;
|
||||||
*p_addr_type = p_dev_rec->ble.ble_addr_type;
|
*p_addr_type = p_dev_rec->ble.ble_addr_type;
|
||||||
} else if (memcmp(p_dev_rec->ble.pseudo_addr, remote_bda, BD_ADDR_LEN) == 0) {
|
} else if (memcmp(p_dev_rec->ble.pseudo_addr, bd_addr_null, BD_ADDR_LEN) != 0 &&
|
||||||
|
memcmp(p_dev_rec->ble.pseudo_addr, remote_bda, BD_ADDR_LEN) == 0) {
|
||||||
*p_dev_type = BT_DEVICE_TYPE_BLE;
|
*p_dev_type = BT_DEVICE_TYPE_BLE;
|
||||||
*p_addr_type = p_dev_rec->ble.ble_addr_type;
|
*p_addr_type = p_dev_rec->ble.ble_addr_type;
|
||||||
} else { /* matching static address only */
|
} else { /* matching static address only */
|
||||||
|
|||||||
@@ -303,7 +303,8 @@ BOOLEAN btm_find_sec_dev_in_list (void *p_node_data, void *context)
|
|||||||
}
|
}
|
||||||
#if BLE_INCLUDED == TRUE
|
#if BLE_INCLUDED == TRUE
|
||||||
// If a LE random address is looking for device record
|
// If a LE random address is looking for device record
|
||||||
if (!memcmp(p_sec_dev->ble.pseudo_addr, p_context->context.p_bd_addr, BD_ADDR_LEN)) {
|
if (memcmp(p_sec_dev->ble.pseudo_addr, bd_addr_null, BD_ADDR_LEN) != 0 &&
|
||||||
|
!memcmp(p_sec_dev->ble.pseudo_addr, p_context->context.p_bd_addr, BD_ADDR_LEN)) {
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user