The patch is trying to fix a real bug (the code never expects the number of usages to be less than the number of values in a report), however the fix is wrong, because later in the hid_add_field() function it can cause the loop whic assigns usages to the field->usage array to access data beyond the end of the parser->local.usage array.
Could you do a proper fix? (Setting the field->usage array to the last defined usage?)
If I'm understanding you correctly, I think the attached patch will prevent reading beyond the parser usage array.
-- James Lamanna Applied Minds, Inc. 1209 Grand Central Ave. Glendale, CA 91201 (818) 332-5214
hid-core.diff
Description: Binary data