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

Commit 5ac2b8da authored by Ted Wang's avatar Ted Wang
Browse files

Fix OOB in sdp_disc_server_rsp

Bug: 79883568
Test: manual
Change-Id: I71cd2f220839018f5b92ad153c1e294b40b07a90
parent c050b1a9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -230,6 +230,12 @@ void sdp_disc_server_rsp(tCONN_CB* p_ccb, BT_HDR* p_msg) {
  p = (uint8_t*)(p_msg + 1) + p_msg->offset;
  uint8_t* p_end = p + p_msg->len;

  if (p_msg->len < 1) {
    android_errorWriteLog(0x534e4554, "79883568");
    sdp_disconnect(p_ccb, SDP_GENERIC_ERROR);
    return;
  }

  BE_STREAM_TO_UINT8(rsp_pdu, p);

  p_msg->len--;