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

Commit b45b8479 authored by Hui Peng's avatar Hui Peng
Browse files

Fix a nullptr-deref in on_create_record_event

Bug: 263545186
Test: manual
Ignore-AOSP-First: security
Change-Id: I0abbb67842850cc2f1298b43dc49a89445b40a43
parent d0fc4262
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -350,9 +350,9 @@ void on_create_record_event(int id) {
  BTIF_TRACE_DEBUG("Sdp Server %s", __func__);
  const sdp_slot_t* sdp_slot = start_create_sdp(id);
  tBTA_SERVICE_ID service_id = -1;
  bluetooth_sdp_record* record;
  /* In the case we are shutting down, sdp_slot is NULL */
  if (sdp_slot != NULL) {
    bluetooth_sdp_record* record = sdp_slot->record_data;
  if (sdp_slot != nullptr && (record = sdp_slot->record_data) != nullptr) {
    int handle = -1;
    switch (record->hdr.type) {
      case SDP_TYPE_MAP_MAS: