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

Commit 9bb449bc authored by Hansong Zhang's avatar Hansong Zhang
Browse files

Fix nullptr in btif_hf_client

When cb is nullptr, this can cause a crash in lines below.

Test: manual
Bug: 180420059
Tag: #security
Change-Id: I09156852f6a99315bf4aebf948efee21a7bcfa1c
parent ad62b8c5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@ static void btif_in_hf_client_generic_evt(uint16_t event, char* p_param) {
  btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(*bd_addr);
  if (cb == NULL || !is_connected(cb)) {
    BTIF_TRACE_ERROR("%s: failed to find block for bda", __func__);
    return;
  }

  BTIF_TRACE_EVENT("%s: event=%d", __func__, event);