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

Commit bc529fda authored by Hui Peng's avatar Hui Peng Committed by Automerger Merge Worker
Browse files

Merge "Add validation on sdp attributes in bta_ag_sdp.cc" into tm-dev am: b4aaf94b

parents 59fffe95 b4aaf94b
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -358,7 +358,9 @@ bool bta_ag_sdp_find_attr(tBTA_AG_SCB* p_scb, tBTA_SERVICE_MASK service) {
      }
      }
      /* get features if HFP */
      /* get features if HFP */
      p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_SUPPORTED_FEATURES);
      p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_SUPPORTED_FEATURES);
      if (p_attr != nullptr) {
      if (p_attr != nullptr &&
          SDP_DISC_ATTR_TYPE(p_attr->attr_len_type) == UINT_DESC_TYPE &&
          SDP_DISC_ATTR_LEN(p_attr->attr_len_type) >= 2) {
        /* Found attribute. Get value. */
        /* Found attribute. Get value. */
        /* There might be race condition between SDP and BRSF.  */
        /* There might be race condition between SDP and BRSF.  */
        /* Do not update if we already received BRSF.           */
        /* Do not update if we already received BRSF.           */
@@ -395,7 +397,9 @@ bool bta_ag_sdp_find_attr(tBTA_AG_SCB* p_scb, tBTA_SERVICE_MASK service) {
      /* get features if HSP */
      /* get features if HSP */
      p_attr =
      p_attr =
          SDP_FindAttributeInRec(p_rec, ATTR_ID_REMOTE_AUDIO_VOLUME_CONTROL);
          SDP_FindAttributeInRec(p_rec, ATTR_ID_REMOTE_AUDIO_VOLUME_CONTROL);
      if (p_attr != nullptr) {
      if (p_attr != nullptr &&
            SDP_DISC_ATTR_TYPE(p_attr->attr_len_type) == BOOLEAN_DESC_TYPE &&
            SDP_DISC_ATTR_LEN(p_attr->attr_len_type) >= 1) {
        /* Remote volume control of HSP */
        /* Remote volume control of HSP */
        if (p_attr->attr_value.v.u8)
        if (p_attr->attr_value.v.u8)
          p_scb->peer_features |= BTA_AG_PEER_FEAT_VOL;
          p_scb->peer_features |= BTA_AG_PEER_FEAT_VOL;