diff options
author | Ajay Panicker <apanicke@google.com> | 2018-01-10 16:58:16 -0800 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-02-26 23:52:36 +0000 |
commit | 8feb7403c2592afa645a61d6aefb3deba02f1266 (patch) | |
tree | 9e07dec35fbba3c332ca9431e1c15f328e4ebf28 | |
parent | 2eb72669da55b2063c1de62574565616a5a03a6b (diff) | |
download | bt-8feb7403c2592afa645a61d6aefb3deba02f1266.tar.gz |
AVRCP: Check the number of text value attributes requested
Test: Builds
Bug: 69479009
Change-Id: I184ddfdb56c15c2b07d52a2624240738efb4d207
(cherry picked from commit 6313da35abc93fcfb783c68f2e02427df9928ecf)
-rw-r--r-- | stack/avrc/avrc_pars_tg.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/stack/avrc/avrc_pars_tg.cc b/stack/avrc/avrc_pars_tg.cc index 1ed6963a8..99d3c7bfa 100644 --- a/stack/avrc/avrc_pars_tg.cc +++ b/stack/avrc/avrc_pars_tg.cc @@ -220,6 +220,11 @@ static tAVRC_STS avrc_pars_vendor_cmd(tAVRC_MSG_VENDOR* p_msg, p_result->get_app_val_txt.num_val) status = AVRC_STS_INTERNAL_ERR; else { + if (p_result->get_app_val_txt.num_val > AVRC_MAX_APP_ATTR_SIZE) { + android_errorWriteLog(0x534e4554, "63146237"); + p_result->get_app_val_txt.num_val = AVRC_MAX_APP_ATTR_SIZE; + } + p_u8 = p_result->get_app_val_txt.vals; for (xx = 0; xx < p_result->get_app_val_txt.num_val; xx++) { p_u8[xx] = *p++; |