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

Commit 5d9b89e7 authored by Yuyang Huang's avatar Yuyang Huang Committed by Gerrit Code Review
Browse files

Merge "Fix a potential null pointer dereference in btif_hf_client_upstreams_evt." into main

parents ab648359 f3bf26a3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -867,6 +867,10 @@ static void process_ind_evt(tBTA_HF_CLIENT_IND* ind) {
static void btif_hf_client_upstreams_evt(uint16_t event, char* p_param) {
  tBTA_HF_CLIENT* p_data = (tBTA_HF_CLIENT*)p_param;

  if (p_data == nullptr) {
    log::error("event={} ({})'s param is null", dump_hf_client_event(event), event);
    return;
  }
  btif_hf_client_cb_t* cb = btif_hf_client_get_cb_by_bda(p_data->bd_addr);
  if (cb == NULL && event == BTA_HF_CLIENT_OPEN_EVT) {
    log::verbose("event BTA_HF_CLIENT_OPEN_EVT allocating block");