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

Commit 417159a8 authored by Chris Manton's avatar Chris Manton
Browse files

Re-log stack/sdp::process_service_search_attr_rsp

Towards loggable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Test: act.py -tc BleCocTest
Change-Id: I61791e5b50d51abdaffc0f9dd6709b94c816e077
parent 056a05a6
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include "hcimsgs.h"
#include "l2cdefs.h"
#include "log/log.h"
#include "osi/include/log.h"
#include "sdp_api.h"
#include "sdpint.h"

@@ -629,9 +630,8 @@ static void process_service_search_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply,
/*******************************************************************/

#if (SDP_RAW_DATA_INCLUDED == TRUE)
  SDP_TRACE_WARNING("process_service_search_attr_rsp");
  if (!sdp_copy_raw_data(p_ccb, true)) {
    SDP_TRACE_ERROR("sdp_copy_raw_data failed");
    LOG_ERROR("sdp_copy_raw_data failed");
    sdp_disconnect(p_ccb, SDP_ILLEGAL_PARAMETER);
    return;
  }
@@ -643,12 +643,12 @@ static void process_service_search_attr_rsp(tCONN_CB* p_ccb, uint8_t* p_reply,
  type = *p++;

  if ((type >> 3) != DATA_ELE_SEQ_DESC_TYPE) {
    SDP_TRACE_WARNING("SDP - Wrong type: 0x%02x in attr_rsp", type);
    LOG_WARN("Wrong element in attr_rsp type:0x%02x", type);
    return;
  }
  p = sdpu_get_len_from_type(p, p + p_ccb->list_len, type, &seq_len);
  if (p == NULL || (p + seq_len) > (p + p_ccb->list_len)) {
    SDP_TRACE_WARNING("%s: bad length", __func__);
    LOG_WARN("Illegal search attribute length");
    sdp_disconnect(p_ccb, SDP_ILLEGAL_PARAMETER);
    return;
  }