Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96c12159 authored by Hui Peng's avatar Hui Peng Committed by Android (Google) Code Review
Browse files

Merge "Fix an OOB bug in btm_ble_write_adv_enable_complete" into tm-dev

parents 993b0731 e38dbb29
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3173,11 +3173,11 @@ void btm_ble_read_remote_features_complete(uint8_t* p) {
 * Returns          void
 *
 ******************************************************************************/
void btm_ble_write_adv_enable_complete(uint8_t* p) {
void btm_ble_write_adv_enable_complete(uint8_t* p, uint16_t evt_len) {
  tBTM_BLE_INQ_CB* p_cb = &btm_cb.ble_ctr_cb.inq_var;

  /* if write adv enable/disbale not succeed */
  if (*p != HCI_SUCCESS) {
  if (evt_len < 1 || *p != HCI_SUCCESS) {
    /* toggle back the adv mode */
    p_cb->adv_mode = !p_cb->adv_mode;
  }
+1 −1
Original line number Diff line number Diff line
@@ -1237,7 +1237,7 @@ static void btu_hcif_hdl_command_complete(uint16_t opcode, uint8_t* p,
      break;

    case HCI_BLE_WRITE_ADV_ENABLE:
      btm_ble_write_adv_enable_complete(p);
      btm_ble_write_adv_enable_complete(p, evt_len);
      break;

    case HCI_BLE_CREATE_LL_CONN:
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ void btm_ble_process_ext_adv_pkt(uint8_t len, const uint8_t* p);
void btm_ble_process_phy_update_pkt(uint8_t len, uint8_t* p);
void btm_ble_read_remote_features_complete(uint8_t* p);
void btm_le_on_advertising_set_terminated(uint8_t* p, uint16_t length);
extern void btm_ble_write_adv_enable_complete(uint8_t* p);
extern void btm_ble_write_adv_enable_complete(uint8_t* p, uint16_t evt_len);
extern void btm_ble_create_ll_conn_complete(tHCI_STATUS status);
extern void btm_ble_ltk_request(uint16_t handle, uint8_t rand[8],
                                uint16_t ediv);
+1 −1
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ void btm_ble_update_mode_operation(uint8_t link_role, const RawAddress* bd_addr,
                                   tHCI_STATUS status) {
  mock_function_count_map[__func__]++;
}
void btm_ble_write_adv_enable_complete(uint8_t* p) {
void btm_ble_write_adv_enable_complete(uint8_t* p, uint16_t evt_len) {
  mock_function_count_map[__func__]++;
}
void btm_clear_all_pending_le_entry(void) {