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

Commit 0a1eb466 authored by li-wei.cheng's avatar li-wei.cheng Committed by Myles Watson
Browse files

Return after removing sample LTK device

Return directly after calling bta_dm_remove_device to
prevent from accessing the invalid security record (p_dev_rec).

Test: Hardcode to test bond with sample key
Tag: #security
Bug: 162497143
Change-Id: Iaa59f3c415dd8066849fd70912fdb83f890229d7
Merged-In: Iaa59f3c415dd8066849fd70912fdb83f890229d7
parent f53866c0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4696,6 +4696,7 @@ void btm_sec_disconnected(uint16_t handle, uint8_t reason) {
    tBTA_DM_MSG p_data;
    memcpy(p_data.remove_dev.bd_addr, p_dev_rec->bd_addr, BD_ADDR_LEN);
    bta_dm_remove_device(&p_data);
    return;
  }

  if (p_dev_rec->sec_state == BTM_SEC_STATE_DISCONNECTING_BOTH) {