diff options
author | Mayank Madhukar <quic_mmadhuka@quicinc.com> | 2023-03-09 22:18:23 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2023-03-24 02:07:15 -0700 |
commit | dfcfdc4ea741fe628ff331cd53ceef06b65bc74c (patch) | |
tree | 249b735df9de76a9db9308bca6226a38c0f08f75 | |
parent | d91dc298a0c1c938f282826beee9f844e54e6fcc (diff) |
btif: Fixing OOB KW Violation.
Change-Id: I575a5fdeb23ead9f091cee08fec35db328fc4d20
-rw-r--r-- | btif/src/btif_rc.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/btif/src/btif_rc.cc b/btif/src/btif_rc.cc index a15b63c87..650f69b54 100644 --- a/btif/src/btif_rc.cc +++ b/btif/src/btif_rc.cc @@ -5145,6 +5145,12 @@ static void handle_app_attr_val_txt_response( } p_app_settings->ext_val_index++; + if (p_app_settings->ext_val_index >= AVRC_MAX_APP_ATTR_SIZE) { + BTIF_TRACE_ERROR("%s: ext_val_index is 0x%02x, overflow!", + __func__, p_app_settings->ext_val_index); + return; + } + if (p_app_settings->ext_val_index < p_app_settings->num_ext_attrs) { attr_index = p_app_settings->ext_val_index; for (xx = 0; xx < p_app_settings->ext_attrs[attr_index].num_val && xx < AVRC_MAX_APP_ATTR_SIZE; xx++) { |