OSDN Git Service

DO NOT MERGE: AVRCP: Check the number of text value attributes requested
authorAjay Panicker <apanicke@google.com>
Thu, 11 Jan 2018 04:50:20 +0000 (20:50 -0800)
committerRyan Longair <rlongair@google.com>
Thu, 18 Jan 2018 00:51:50 +0000 (16:51 -0800)
Test: Builds
Bug: 69479009
Change-Id: Ibd6a448eda65f857ddfacc1ee7ad1ead3b46fb8d
(cherry picked from commit 03ffdc94b07ad40d99b298137877aa9b5ebecb58)

stack/avrc/avrc_pars_tg.c

index b62ec60..820e99f 100644 (file)
@@ -236,6 +236,11 @@ static tAVRC_STS avrc_pars_vendor_cmd(tAVRC_MSG_VENDOR *p_msg, tAVRC_COMMAND *p_
                     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++)
                     {