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

Commit 13f16050 authored by Priti Aghera's avatar Priti Aghera Committed by Andre Eisenbach
Browse files

Null check for irk entry

When BT is turning off btm_ble_vendor control block is cleaned up.
So irk_entry which points to the first element of irk_list is NULL
Included a null check for irk_entry to prevent stack crash.

Bug 17399097

Change-Id: Ib129f7dd06f9db61cc54257aa4a563fe2c9f41f2
parent 153f2e0e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -173,6 +173,9 @@ tBTM_BLE_IRK_ENTRY * btm_ble_vendor_find_irk_entry_by_psuedo_addr (BD_ADDR psued
    tBTM_BLE_IRK_ENTRY  *p_irk_entry = &btm_ble_vendor_cb.irk_list[0];
    UINT8   i;

    if(p_irk_entry == NULL)
        return NULL;

    for (i = 0; i < btm_cb.cmn_ble_vsc_cb.max_irk_list_sz; i ++, p_irk_entry++)
    {
        if (p_irk_entry->in_use && memcmp(p_irk_entry->psuedo_bda, psuedo_bda, BD_ADDR_LEN) == 0)