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

Commit d4a68004 authored by Sandeep Samdaria's avatar Sandeep Samdaria
Browse files

Parse the headers before profile id extraction

Problem: When both profiles are enabled, profile id is exctracted
from the buffer w/o parsing the headers.

Solution: Short-term fix to parse the header first and then extract
the profile id from the buffer.
Long-term fix would involve removing the duplicate method (cautiously)

Bug: 325660319
Bug: 321806163
Test: atest net_bt_*
Change-Id: I6af6c8d003d2b33309215d00f2b840b6d0caae9e
parent 5c03a6e6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ cc_library_static {
        "pan/pan_utils.cc",
    ],
    static_libs: [
        "bluetooth_flags_c_lib",
        "libbluetooth_crypto_toolbox",
        "libbluetooth_hci_pdl",
        "libbluetooth_log",
@@ -598,7 +599,11 @@ cc_fuzz {
        "avrc/*.cc",
        "fuzzers/avrc_fuzzer.cc",
    ],
    shared_libs: [
        "server_configurable_flags",
    ],
    static_libs: [
        "bluetooth_flags_c_lib",
        "libbase",
        "libbluetooth-types",
        "libbluetooth_hci_pdl",
+5 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
 *  This module contains action functions of the link control state machine.
 *
 ******************************************************************************/
#include <android_bluetooth_flags.h>
#include <android_bluetooth_sysprop.h>
#include <bluetooth/log.h>
#include <string.h>
@@ -718,9 +719,12 @@ bool avct_msg_ind_for_src_sink_coexist(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data,
  tAVCT_CCB* p_ccb;
  int p_buf_len;
  uint8_t* p;
  uint16_t pid;
  uint16_t pid, type;

  p = (uint8_t*)(p_data->p_buf + 1) + p_data->p_buf->offset;
  if (IS_FLAG_ENABLED(a2dp_concurrent_source_sink)) {
    AVCT_PARSE_HDR(p, label, type, cr_ipid);
  }

  BE_STREAM_TO_UINT16(pid, p);