Skip to content

Bug in USBDeviceClass.sendStringDecscriptor/sendDescriptor may send malformed descriptors. #350

@alphaleonis

Description

@alphaleonis

sendStringDescriptor accepts a uint8_t as maxlen, however calling code (from sendDescriptor) passes in wLength from the request packet, which is an uint16_t and may be larger than 255, causing maxlen to be truncated and an invalid packet sent.

This has been fixed in the upstream, so catching up with that would fix the issue.

(The issue occurred for me on Windows which sends 2050 as wLength in the Get descriptor request, which is truncated to one bytes causing sendDescriptor to send an essentially empty packet with incorrect length).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions