• reillyg's avatar
    Store HID report sizes as uint16_t. · 70cdd67c
    reillyg authored
    HID report sizes are unsigned values. In addition they should (because
    of the limited size of USB control transfers) never be larger than 64k.
    In reality that would be an absolutely enormous report and unlikely to
    ever been seen in the wild. By limiting the storage size for report
    lengths to a uint16_t we therefore also limit our exposure to being
    convinced to allocate unreasonably large buffers by a malicious device.
    The Windows HID parser already limits report sizes to a USHORT value.
    
    BUG=
    
    Review URL: https://codereview.chromium.org/492963007
    
    Cr-Commit-Position: refs/heads/master@{#291624}
    70cdd67c
hid_report_descriptor.cc 5.12 KB