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

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

Add validation on sdp attributes in bta_dm_disc.cc

Originally in bta_dm_act.cc, moved to bta_dm_disc.cc

Bug: 263958603
Test: atest bt_host_test_bta
Ignore-AOSP-First: security
Tag: #security
Merged-In: I2aaadea6ce65f5fce2c9a7a2d66ee704e2fd5949
(cherry picked from commit ed3d8638)
Change-Id: I7bdf55320e7582cf2663a640bcaf071d06ee156f
parent 5b7b12d3
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -507,7 +507,9 @@ static void store_avrcp_profile_feature(tSDP_DISC_REC* sdp_rec) {
  tSDP_DISC_ATTR* p_attr =
      get_legacy_stack_sdp_api()->record.SDP_FindAttributeInRec(
          sdp_rec, ATTR_ID_SUPPORTED_FEATURES);
  if (p_attr == NULL) {
  if (p_attr == NULL ||
      SDP_DISC_ATTR_TYPE(p_attr->attr_len_type) != UINT_DESC_TYPE ||
      SDP_DISC_ATTR_LEN(p_attr->attr_len_type) < 2) {
    return;
  }