aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAjay Panicker <apanicke@google.com>2018-01-10 16:12:50 -0800
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-01-18 19:08:17 +0000
commit2f2043f18463a5c963c138d24346870b1066e7a6 (patch)
tree02883b31fd0dc1d8dfa5f8757002aa6ae2366245
parent49a57cd2346a716eca07153ac83026787fb9d03a (diff)
downloadbt-2f2043f18463a5c963c138d24346870b1066e7a6.tar.gz
AVRCP: Check the number of text attributes requested
Test: Build Bug: 69478941 Change-Id: Ibc456511c8d7339213f08b07d70f5e25be140d68 (cherry picked from commit 249bb665b1020e81547246f5b29ed9040d696388)
-rw-r--r--stack/avrc/avrc_pars_tg.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/stack/avrc/avrc_pars_tg.cc b/stack/avrc/avrc_pars_tg.cc
index cc5ec1de0..1ed6963a8 100644
--- a/stack/avrc/avrc_pars_tg.cc
+++ b/stack/avrc/avrc_pars_tg.cc
@@ -21,6 +21,7 @@
#include "avrc_defs.h"
#include "avrc_int.h"
#include "bt_common.h"
+#include "log/log.h"
/*****************************************************************************
* Global data
@@ -158,6 +159,12 @@ static tAVRC_STS avrc_pars_vendor_cmd(tAVRC_MSG_VENDOR* p_msg,
status = AVRC_STS_INTERNAL_ERR;
break;
}
+
+ if (p_result->get_cur_app_val.num_attr > AVRC_MAX_APP_ATTR_SIZE) {
+ android_errorWriteLog(0x534e4554, "63146237");
+ p_result->get_cur_app_val.num_attr = AVRC_MAX_APP_ATTR_SIZE;
+ }
+
p_u8 = p_result->get_cur_app_val.attrs;
for (xx = 0, yy = 0; xx < p_result->get_cur_app_val.num_attr; xx++) {
/* only report the valid player app attributes */