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

Commit e262b59a authored by Chris Manton's avatar Chris Manton
Browse files

legacy: Check nullptr security device record list

Bug: 195773527
Tag: #refactor
Test: gd/cert/run
Change-Id: Ib4b46cc683350993c1a952ad3939ddeabdfc09ef
parent 6d0141ed
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -342,6 +342,8 @@ bool is_address_equal(void* data, void* context) {
 *
 ******************************************************************************/
tBTM_SEC_DEV_REC* btm_find_dev(const RawAddress& bd_addr) {
  if (btm_cb.sec_dev_rec == nullptr) return nullptr;

  list_node_t* n =
      list_foreach(btm_cb.sec_dev_rec, is_address_equal, (void*)&bd_addr);
  if (n) return static_cast<tBTM_SEC_DEV_REC*>(list_node(n));