mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Dereference after null check
This commit is contained in:
parent
01a7b1de70
commit
33fd228c9d
@ -490,9 +490,14 @@ void bta_gattc_open(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
|
||||
{
|
||||
tBTA_GATTC_DATA gattc_data;
|
||||
BOOLEAN found_app = FALSE;
|
||||
tGATT_TCB *p_tcb;
|
||||
|
||||
tGATT_TCB *p_tcb = gatt_find_tcb_by_addr(p_data->api_conn.remote_bda, BT_TRANSPORT_LE);
|
||||
if(p_tcb && p_clcb && p_data) {
|
||||
if (!p_clcb || !p_data) {
|
||||
return;
|
||||
}
|
||||
|
||||
p_tcb = gatt_find_tcb_by_addr(p_data->api_conn.remote_bda, BT_TRANSPORT_LE);
|
||||
if(p_tcb) {
|
||||
found_app = gatt_find_specific_app_in_hold_link(p_tcb, p_clcb->p_rcb->client_if);
|
||||
}
|
||||
/* open/hold a connection */
|
||||
|
@ -1435,6 +1435,8 @@ tBTM_STATUS BTM_BleSetAdvParamsAll(UINT16 adv_int_min, UINT16 adv_int_max, UINT8
|
||||
|
||||
if (p_dir_bda) {
|
||||
memcpy(&p_cb->direct_bda, p_dir_bda, sizeof(tBLE_BD_ADDR));
|
||||
} else {
|
||||
return BTM_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
BTM_TRACE_EVENT ("update params for an active adv\n");
|
||||
|
@ -1521,8 +1521,8 @@ void BTM_ConfirmReqReply(tBTM_STATUS res, BD_ADDR bd_addr)
|
||||
if (res == BTM_SUCCESS) {
|
||||
if ((p_dev_rec = btm_find_dev (bd_addr)) != NULL) {
|
||||
p_dev_rec->sec_flags |= BTM_SEC_LINK_KEY_AUTHED;
|
||||
p_dev_rec->sec_flags |= BTM_SEC_16_DIGIT_PIN_AUTHED;
|
||||
}
|
||||
p_dev_rec->sec_flags |= BTM_SEC_16_DIGIT_PIN_AUTHED;
|
||||
}
|
||||
|
||||
btsnd_hcic_user_conf_reply (bd_addr, TRUE);
|
||||
|
@ -140,19 +140,20 @@ void gatt_verify_signature(tGATT_TCB *p_tcb, BT_HDR *p_buf)
|
||||
*******************************************************************************/
|
||||
void gatt_sec_check_complete(BOOLEAN sec_check_ok, tGATT_CLCB *p_clcb, UINT8 sec_act)
|
||||
{
|
||||
if (p_clcb && p_clcb->p_tcb &&
|
||||
fixed_queue_is_empty(p_clcb->p_tcb->pending_enc_clcb)) {
|
||||
gatt_set_sec_act(p_clcb->p_tcb, GATT_SEC_NONE);
|
||||
}
|
||||
if (p_clcb && p_clcb->p_tcb) {
|
||||
if (fixed_queue_is_empty(p_clcb->p_tcb->pending_enc_clcb)) {
|
||||
gatt_set_sec_act(p_clcb->p_tcb, GATT_SEC_NONE);
|
||||
}
|
||||
#if (GATTC_INCLUDED == TRUE)
|
||||
if (!sec_check_ok) {
|
||||
gatt_end_operation(p_clcb, GATT_AUTH_FAIL, NULL);
|
||||
} else if (p_clcb->operation == GATTC_OPTYPE_WRITE) {
|
||||
gatt_act_write(p_clcb, sec_act);
|
||||
} else if (p_clcb->operation == GATTC_OPTYPE_READ) {
|
||||
gatt_act_read(p_clcb, p_clcb->counter);
|
||||
}
|
||||
if (!sec_check_ok) {
|
||||
gatt_end_operation(p_clcb, GATT_AUTH_FAIL, NULL);
|
||||
} else if (p_clcb->operation == GATTC_OPTYPE_WRITE) {
|
||||
gatt_act_write(p_clcb, sec_act);
|
||||
} else if (p_clcb->operation == GATTC_OPTYPE_READ) {
|
||||
gatt_act_read(p_clcb, p_clcb->counter);
|
||||
}
|
||||
#endif ///GATTC_INCLUDED == TRUE
|
||||
}
|
||||
}
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
@ -940,8 +940,8 @@ void l2c_process_timeout (TIMER_LIST_ENT *p_tle)
|
||||
if (p_lcb){
|
||||
p_lcb->conn_update_mask &= ~L2C_BLE_UPDATE_PENDING;
|
||||
p_lcb->conn_update_mask &= ~L2C_BLE_UPDATE_PARAM_FULL;
|
||||
l2c_send_update_conn_params_cb(p_lcb, status);
|
||||
}
|
||||
l2c_send_update_conn_params_cb(p_lcb, status);
|
||||
#endif ///BLE_INCLUDED == TRUE
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user