[libhid-discuss] Patch: hid_compare_usb_device returns false positives

Christopher raccoonone at procyongames.com
Tue Aug 26 19:43:26 UTC 2008


hid_compare_usb_device() returns false positives for devices with 
similar vendor or product ids.
In the current code we check:
"if ((dev->descriptor.idProduct & match->product_id) == match->product_id)"
However, "(dev->descriptor.idProduct & match->product_id) == 
match->product_id" does not imply that dev->descriptor.idProduct == 
match->product_id.
Example:
idProduct = 0x0011
product_id = 0x0001
idProduct & product_id == 0x0001

Let me know if the patch is not formatted properly,
Christopher Berner

-------------- next part --------------
A non-text attachment was scrubbed...
Name: compare_usb.diff
Type: text/x-diff
Size: 836 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20080826/e6810d9c/attachment.diff 


More information about the libhid-discuss mailing list