mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 15:14:38 +01:00
driver-hidpp10: fix integer overflow when profile count is unset
Blame C for implicit conversions.
This commit is contained in:
@@ -656,7 +656,15 @@ hidpp10drv_probe(struct ratbag_device *device)
|
||||
else if (strcasecmp("G9", typestr) == 0)
|
||||
type = HIDPP10_PROFILE_G9;
|
||||
|
||||
profile_count = ratbag_device_data_hidpp10_get_profile_count(device->data);
|
||||
rc = ratbag_device_data_hidpp10_get_profile_count(device->data);
|
||||
if (rc == -1) {
|
||||
log_error(device->ratbag,
|
||||
"Device %s has no profile count set, even though profiles are enabled. "
|
||||
"Please adjust the .device file.\n",
|
||||
device->name);
|
||||
} else {
|
||||
profile_count = (unsigned int)rc;
|
||||
};
|
||||
}
|
||||
|
||||
device_idx = ratbag_device_data_hidpp10_get_index(device->data);
|
||||
|
||||
Reference in New Issue
Block a user