[PATCH 2/3] monitor: Fix for GetElementAttributes when AttributeValueLength zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



      AVCTP Control: Response: type 0x00 label 0 PID 0x110e
        AV/C: Stable: address 0x48 opcode 0x00
          Subunit: Panel
          Opcode: Vendor Dependent
          Company ID: 0x001958
          AVRCP: GetElementAttributes pt Single len 0x0019
            AttributeCount: 0x03
            Attribute: 0x00000001 (Title)
            CharsetID: 0x006a (UTF-8)
            AttributeValueLength: 0x0000
            AttributeValue:
            Attribute: 0x00000002 (Artist)
            CharsetID: 0x006a (UTF-8)
            AttributeValueLength: 0x0000
            AttributeValue:
            Attribute: 0x00000003 (Album)
            CharsetID: 0x006a (UTF-8)
            AttributeValueLength: 0x0000
            AttributeValue:
---
 monitor/avctp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/monitor/avctp.c b/monitor/avctp.c
index 11dc9b2..af91ecc 100644
--- a/monitor/avctp.c
+++ b/monitor/avctp.c
@@ -1122,7 +1122,7 @@ response:
 		num = avrcp_continuing.num;
 
 		if (avrcp_continuing.size > 0) {
-			char attrval[UINT8_MAX];
+			char attrval[UINT8_MAX] = {0};
 			uint16_t size;
 			uint8_t idx;
 
@@ -1157,7 +1157,7 @@ response:
 		uint32_t attr;
 		uint16_t charset, attrlen;
 		uint8_t idx;
-		char attrval[UINT8_MAX];
+		char attrval[UINT8_MAX] = {0};
 
 		if (!l2cap_frame_get_be32(frame, &attr))
 			goto failed;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux