Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0e1cf8c authored by Alice Kuo's avatar Alice Kuo
Browse files

Only parse ATT_READ_BY_TYPE_RSP for the charactertistic type

We parse ATT_READ_BY_TYPE_RSP packet to know the ASE control point UUID,
so ignore the other packet and avoid the tool crash as the packer length
shorted than expected

Bug: 232731251
Test: ./dump_le_audio.py BTSNOOP.cfa -v --header
Change-Id: I314e8b7ff0e205a42f1f125c48b96a966191bed7
Merged-In: I314e8b7ff0e205a42f1f125c48b96a966191bed7
(cherry picked from commit 114d8036)
parent 36fb8ceb
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -215,6 +215,10 @@ def parse_codec_information(connection_handle, ase_id, packet):

def parse_att_read_by_type_rsp(packet, connection_handle):
    length, packet = unpack_data(packet, 1, False)
    if length != 7:
        #ignore the packet, we're only interested in this packet for the characteristic type UUID
        return

    if length > len(packet):
        debug_print("Invalid att packet length")
        return