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

Commit 4cd7b6a9 authored by Hansong Zhang's avatar Hansong Zhang Committed by android-build-merger
Browse files

Merge "Fix unexpected behavior in SDP" into oc-dev am: 2b713519 am: c5958c9b

am: 0c1452ed

Change-Id: Id5df3f342cf280b8041c10bd9c5192f2e19b3140
parents 6974f0f4 0c1452ed
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@
 *
 ******************************************************************************/

#include <cutils/log.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -341,6 +343,12 @@ static void process_service_attr_req(tCONN_CB* p_ccb, uint16_t trans_num,
    return;
  }

  if (max_list_len < 4) {
    sdpu_build_n_send_error(p_ccb, trans_num, SDP_ILLEGAL_PARAMETER, NULL);
    android_errorWriteLog(0x534e4554, "68776054");
    return;
  }

  /* Free and reallocate buffer */
  osi_free(p_ccb->rsp_list);
  p_ccb->rsp_list = (uint8_t*)osi_malloc(max_list_len);
@@ -551,6 +559,12 @@ static void process_service_search_attr_req(tCONN_CB* p_ccb, uint16_t trans_num,

  memcpy(&attr_seq_sav, &attr_seq, sizeof(tSDP_ATTR_SEQ));

  if (max_list_len < 4) {
    sdpu_build_n_send_error(p_ccb, trans_num, SDP_ILLEGAL_PARAMETER, NULL);
    android_errorWriteLog(0x534e4554, "68817966");
    return;
  }

  /* Free and reallocate buffer */
  osi_free(p_ccb->rsp_list);
  p_ccb->rsp_list = (uint8_t*)osi_malloc(max_list_len);