Fix out of bound read of 'has_hat' array
This commit is contained in:
committed by
Sam Lantinga
parent
94f48f19b0
commit
94b3f78c44
@@ -1149,7 +1149,7 @@ static void ConfigJoystick(SDL_Joystick *joystick, int fd, int fd_sensor)
|
|||||||
}
|
}
|
||||||
for (i = 0; i < ABS_MAX; ++i) {
|
for (i = 0; i < ABS_MAX; ++i) {
|
||||||
/* Skip digital hats */
|
/* Skip digital hats */
|
||||||
if (joystick->hwdata->has_hat[(i - ABS_HAT0X) / 2]) {
|
if (i >= ABS_HAT0X && i <= ABS_HAT3Y && joystick->hwdata->has_hat[(i - ABS_HAT0X) / 2]) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (test_bit(i, absbit)) {
|
if (test_bit(i, absbit)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user