Solaar/lib
Ken Sanislo d561d9f70d Guard Centurion feature lookups against HID++ 2.0 enum collisions
IntEnum members with the same int value hash equal and compare equal,
so a dict lookup for SupportedFeature.DEVICE_NAME (0x0005) finds an
entry stored as CenturionCoreFeature.MULTI_HOST_CONTROL (same 0x0005).
The index is right for the Centurion feature but wrong for the HID++
2.0 feature the caller intended.

Concrete impact: `solaar show` on wired G522 called get_kind()
-> feature_request(DEVICE_NAME, 0x20), which resolved to
MULTI_HOST_CONTROL.function_2 via the collision, and the device
returned OUT_OF_RANGE -> FeatureCallError crashed `solaar show`.

Fix: in Device.feature_request, after resolving the index, compare the
type of the stored inverse entry against the type of the requested
feature. Mismatched types mean the device actually has the Centurion
variant, not the HID++ 2.0 feature — return None instead of issuing a
mis-targeted request.
2026-04-16 23:36:47 -07:00
..
hid_parser Fix warnings from automatic code inspections 2024-10-11 07:42:38 -04:00
hidapi Add G522 LIGHTSPEED headset support (Centurion 0x50 transport variant) 2026-04-14 10:52:08 -07:00
keysyms keysymdef: Rename key symbols 2024-10-11 07:42:38 -04:00
logitech_receiver Guard Centurion feature lookups against HID++ 2.0 enum collisions 2026-04-16 23:36:47 -07:00
solaar Fix G522 0x50 Centurion init failure and protocol version crash 2026-04-15 23:00:45 -07:00