]> sigrok.org Git - libsigrokdecode.git/commit
usb_packet: Handle truncated data packets.
authorVegard Storheil Eriksen <redacted>
Tue, 5 May 2020 18:27:26 +0000 (20:27 +0200)
committerSoeren Apel <redacted>
Tue, 1 Oct 2024 11:47:37 +0000 (13:47 +0200)
commit80e993bab984143e645efe789fec35882063ace7
treef836b084b3e73417e525c96eba188cf84f0304b2
parent1677e1b5a6c2837bd9441dc7e228b9e67759661e
usb_packet: Handle truncated data packets.

Attempting to decode a truncated data packet would raise an exception,
leaving the decoder in a state where next packet will get appended to it
and decoded as one packet.

This patch adds an explicit check for length before trying to decode the
data and CRC fields, allowing graceful handling of truncated packets.
decoders/usb_packet/pd.py