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

Commit 8752381f authored by Aritra Sen's avatar Aritra Sen
Browse files

Handle null pointer error for BTA JV callbacks for GAP events when data...

Handle null pointer error for BTA JV callbacks for GAP events when data returned is null (which is the case in most places. Not handling this leads to Bluetooth crashes

Bug: 269406835
Test: mma -j $(nproc)
Change-Id: I887f3197c18c06e0d81ffd6a53c69a3de1972632
parent cdcb2c1f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -932,7 +932,9 @@ static void bta_jv_l2cap_client_cback(uint16_t gap_handle, uint16_t event,
      p_cb->state = BTA_JV_ST_NONE;
      bta_jv_free_sec_id(&p_cb->sec_id);
      evt_data.l2c_close.async = true;
      evt_data.l2c_close.reason = bta_jv_from_gap_l2cap_err(data->l2cap_result);
      evt_data.l2c_close.reason =
          data != nullptr ? bta_jv_from_gap_l2cap_err(data->l2cap_result)
                          : BTA_JV_L2CAP_REASON_EMPTY;
      p_cb->p_cback(BTA_JV_L2CAP_CLOSE_EVT, &evt_data, p_cb->l2cap_socket_id);
      p_cb->p_cback = NULL;
      break;