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

Commit 87eae3ea authored by Jack He's avatar Jack He
Browse files

Add missing brackets for "if" statement inside BTM_ConfirmReqReply()

This fixes a potential NULL-pointer reference crash in case
btm_find_dev() returns NULL.

Test: mm -j 8
Change-Id: Ic154b872ca84b4e9e8bc57803a4d9ee7c1665204
parent c5108022
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1537,10 +1537,11 @@ void BTM_ConfirmReqReply(tBTM_STATUS res, BD_ADDR bd_addr)

        if (res == BTM_SUCCESS)
        {
            if ((p_dev_rec = btm_find_dev (bd_addr)) != NULL)
            if ((p_dev_rec = btm_find_dev (bd_addr)) != NULL) {
                p_dev_rec->sec_flags |= BTM_SEC_LINK_KEY_AUTHED;
                p_dev_rec->sec_flags |= BTM_SEC_16_DIGIT_PIN_AUTHED;
            }
        }

        btsnd_hcic_user_conf_reply (bd_addr, true);
    }