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

Commit 94d013c7 authored by Hansong Zhang's avatar Hansong Zhang Committed by Automerger Merge Worker
Browse files

Fix a security issue in sdp_server.cc am: db169d7e am: 6f02e4d5 am:...

Fix a security issue in sdp_server.cc am: db169d7e am: 6f02e4d5 am: fdf4c012 am: dbc614ae am: faa2aa19 am: 95ff7406 am: a28ecf8b

Original change: https://googleplex-android-review.googlesource.com/c/platform/system/bt/+/12776129

Change-Id: I261891b06e08565fd107e8c19ab43423a29172e6
parents ba3d9511 a28ecf8b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -118,9 +118,11 @@ void sdp_server_handle_client_req(tCONN_CB* p_ccb, BT_HDR* p_msg) {

  if (p_req + sizeof(pdu_id) + sizeof(trans_num) > p_req_end) {
    android_errorWriteLog(0x534e4554, "69384124");
    android_errorWriteLog(0x534e4554, "169342531");
    trans_num = 0;
    sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX,
                            SDP_TEXT_BAD_HEADER);
    return;
  }

  /* The first byte in the message is the pdu type */
@@ -131,8 +133,10 @@ void sdp_server_handle_client_req(tCONN_CB* p_ccb, BT_HDR* p_msg) {

  if (p_req + sizeof(param_len) > p_req_end) {
    android_errorWriteLog(0x534e4554, "69384124");
    android_errorWriteLog(0x534e4554, "169342531");
    sdpu_build_n_send_error(p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX,
                            SDP_TEXT_BAD_HEADER);
    return;
  }

  BE_STREAM_TO_UINT16(param_len, p_req);