OSDN Git Service

Return after removing sample LTK device
authorli-wei.cheng <li-wei.cheng@mediatek.com>
Mon, 20 Jan 2020 07:27:21 +0000 (15:27 +0800)
committerMyles Watson <mylesgw@google.com>
Thu, 6 Aug 2020 18:51:32 +0000 (18:51 +0000)
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

stack/btm/btm_sec.cc

index e6f02eb..a89378d 100644 (file)
@@ -4551,6 +4551,7 @@ void btm_sec_disconnected(uint16_t handle, uint8_t reason) {
               << p_dev_rec->bd_addr;
 
     bta_dm_remove_device(p_dev_rec->bd_addr);
+    return;
   }
 
   BTM_TRACE_EVENT("%s after update sec_flags=0x%x", __func__,