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

Commit d2ece4b2 authored by Zhihai Xu's avatar Zhihai Xu
Browse files

Crash after unpairing BT keyboard

The crash is caused to access an array use invalid index value.
The solution is to check the index before access the array.
bug:10992001

Change-Id: Iad83764de9545fb2348105cf9cd9d32a85f1d654
parent 222a2ddd
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -452,7 +452,8 @@ BOOLEAN bta_hh_hdl_event(BT_HDR *p_msg)
                      * So if REMOVE_DEVICE is called and in_use is FALSE then we should treat this as a NULL p_cb. Hence we
                      * force the index to be IDX_INVALID
                      */
                    if (bta_hh_cb.kdev[index].in_use == FALSE) {
                    if ((index != BTA_HH_IDX_INVALID) &&
                        (bta_hh_cb.kdev[index].in_use == FALSE)) {
                        index = BTA_HH_IDX_INVALID;
                    }
// btla-specific --