SDL/src
Sam Lantinga a1a2f9b9f8 Fixed bug 4486 - Segfault when pressing a trigger on the Steam Controller (Linux)
Matteo Beniamino

Pressing a trigger button on a Steam Controller causes a segmentation fault both with stable version and latest mercurial head on Linux. I'm using the recent hid_steam kernel module with lizard_mode disabled (that is no keyboard/mouse emulation). I suspect this is what's happening: the driver exposes two hats. The two hats have indices 0 and 2. Inside linux/SDL_sysjoystick.c two hats are allocated in allocate_hatdata for joystick->hwdata->hats. In HandleHat function the hat parameter (that can be 2) is directly used as the index of the array that only has two elements, causing an out of bounds access. SDL is not expecting to have "holes" between hats indices.

The index 2 is calculated in HandleInputEvents() as (ABS_HAT2X - ABS_HAT0X) / 2 where ABS_HAT2X is the value associated to the hat inside the hid_steam module.
2019-06-12 10:32:36 -07:00
..
atomic Updated copyright for 2019 2019-01-04 22:01:14 -08:00
audio SDL_Wave: missing field 'length' initializer 2019-06-12 10:42:02 +02:00
core Fixed bug 4665 - Add support for single touch evdev devices 2019-06-12 07:55:48 -07:00
cpuinfo Fixed bug 4557 - SDL_SIMDAlloc and *Free should be in the public interface 2019-06-08 14:54:37 -07:00
dynapi Fixed bug 4526 - replace SDL_RW* macros with functions for using in bindings 2019-06-08 17:43:23 -07:00
events Return an error if both mouse relative mode and mouse warping are unavailable, instead of asserting. 2019-05-23 11:32:36 -07:00
file Fixed bug 4526 - replace SDL_RW* macros with functions for using in bindings 2019-06-08 17:43:23 -07:00
filesystem Updated copyright for 2019 2019-01-04 22:01:14 -08:00
haptic Updated copyright for 2019 2019-01-04 22:01:14 -08:00
hidapi Protect against NULL device in the Android hidapi implementation 2019-06-07 09:00:26 -07:00
joystick Fixed bug 4486 - Segfault when pressing a trigger on the Steam Controller (Linux) 2019-06-12 10:32:36 -07:00
libm Updated copyright for 2019 2019-01-04 22:01:14 -08:00
loadso Updated copyright for 2019 2019-01-04 22:01:14 -08:00
main Added support for building SDL as a dynamic library on iOS 2019-03-19 07:53:33 -07:00
power Updated copyright for 2019 2019-01-04 22:01:14 -08:00
render software: Fixed compiler warning and dos2unix'd the endlines. 2019-06-11 15:06:35 -04:00
sensor Updated copyright for 2019 2019-01-04 22:01:14 -08:00
stdlib riscos: Fix iconv warnings 2019-01-13 23:36:31 +00:00
test test: unify all the command line usage logging. 2019-05-28 17:39:13 -04:00
thread Hopefully fixed the mingw32 build 2019-03-19 17:20:54 -07:00
timer Updated copyright for 2019 2019-01-04 22:01:14 -08:00
video Fixed bug 4570 - Support Vulkan Portability rather than MoltenVK specifically 2019-06-11 18:13:46 -07:00
SDL.c events: Make debug logging of the event queue a hint instead of an #ifdef. 2019-03-15 14:08:30 -04:00
SDL_assert.c assert: mark SDL_ExitProcess as SDL_NORETURN again. 2019-06-11 21:57:30 -04:00
SDL_assert_c.h Updated copyright for 2019 2019-01-04 22:01:14 -08:00
SDL_dataqueue.c Updated copyright for 2019 2019-01-04 22:01:14 -08:00
SDL_dataqueue.h Updated copyright for 2019 2019-01-04 22:01:14 -08:00
SDL_error.c Fix DirectInput error codes being lost 2019-03-16 18:11:09 -07:00
SDL_error_c.h Updated copyright for 2019 2019-01-04 22:01:14 -08:00
SDL_hints.c Updated copyright for 2019 2019-01-04 22:01:14 -08:00
SDL_internal.h Updated copyright for 2019 2019-01-04 22:01:14 -08:00
SDL_log.c Updated copyright for 2019 2019-01-04 22:01:14 -08:00