diff options
author | Scott Lobdell <slobdell@google.com> | 2022-06-13 17:31:27 +0000 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2022-06-13 17:36:26 +0000 |
commit | 96230268500ca72fd4d4c4cb15c54dbfd268ac89 (patch) | |
tree | ed9f7baeca3035a0e01d0de1b97ee361fbb1cb09 /system/stack/l2cap/l2c_ble.cc | |
parent | 5ccf9c5f1a35b5f4ee2ea952df82dfe6706e043c (diff) | |
parent | 197e748fe27845baab411394ac5aaaae5337663a (diff) |
Merge TP1A.220609.001
Change-Id: I6c3c168fb196a53feb1d2688b74bea4fdbc5b3e8
Diffstat (limited to 'system/stack/l2cap/l2c_ble.cc')
-rwxr-xr-x | system/stack/l2cap/l2c_ble.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/system/stack/l2cap/l2c_ble.cc b/system/stack/l2cap/l2c_ble.cc index e3ce2c93b9..5ab208ced3 100755 --- a/system/stack/l2cap/l2c_ble.cc +++ b/system/stack/l2cap/l2c_ble.cc @@ -26,6 +26,7 @@ #include <base/logging.h> #include <base/strings/stringprintf.h> +#include <log/log.h> #include "bt_target.h" #include "bta/include/bta_hearing_aid_api.h" @@ -522,6 +523,15 @@ void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) { /* Check how many channels remote side wants. */ num_of_channels = (p_pkt_end - p) / sizeof(uint16_t); + if (num_of_channels > L2CAP_CREDIT_BASED_MAX_CIDS) { + android_errorWriteLog(0x534e4554, "232256974"); + LOG_WARN("L2CAP - invalid number of channels requested: %d", + num_of_channels); + l2cu_reject_credit_based_conn_req(p_lcb, id, + L2CAP_CREDIT_BASED_MAX_CIDS, + L2CAP_LE_RESULT_INVALID_PARAMETERS); + return; + } LOG_DEBUG( "Recv L2CAP_CMD_CREDIT_BASED_CONN_REQ with " |