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

Commit 9bcf0f19 authored by Hui Peng's avatar Hui Peng Committed by Gerrit Code Review
Browse files

Merge "Fix a potential OOB bug in PhoneStateChange"

parents 52688927 1343103e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1153,7 +1153,7 @@ bt_status_t HeadsetInterface::PhoneStateChange(

  const RawAddress raw_address(*bd_addr);
  int idx = btif_hf_idx_by_bdaddr(bd_addr);
  if (idx < 0 || idx > BTA_AG_MAX_NUM_CLIENTS) {
  if (idx < 0 || idx >= BTA_AG_MAX_NUM_CLIENTS) {
    LOG_WARN("Invalid index %d for %s", idx, PRIVATE_ADDRESS(raw_address));
    return BT_STATUS_FAIL;
  }