eden/src/hid_core
BoiledElectricity 470d43df6d
Some checks are pending
tx-src / sources (push) Waiting to run
Check Strings / check-strings (push) Waiting to run
[hid_core] fix bounds-check aruid index in GetControllerFromNpadIdType (#4064)
GetIndexFromAruid returns AruidIndexMax as the “not found” value, but both
GetControllerFromNpadIdType overloads were using that value to index
controller_data without checking it first.

when a game routes through DisconnectNpad before its applet resource is
registered, we can end up indexing past the end of controller_data. That seems
to be what was crashing some games on launch, especially on macOS and Android,
where the out-of-bounds read is less likely to just slide by unnoticed.

So yeah, AruidIndexMax is a sentinel, not a real controller_data index, so we
should not treat it like one.

  Fixes: https://github.com/eden-emulator/Issue-Reports/issues/438
  Fixes: https://github.com/eden-emulator/Issue-Reports/issues/439

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4064
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
2026-06-05 19:26:21 +02:00
..
frontend [*] basic in-house cpp linting (#4039) 2026-06-04 05:49:07 +02:00
hidbus [meta] fix license headers (#2547) 2025-09-21 21:58:59 +02:00
irsensor [meta] fix license headers (#2547) 2025-09-21 21:58:59 +02:00
resources [hid_core] fix bounds-check aruid index in GetControllerFromNpadIdType (#4064) 2026-06-05 19:26:21 +02:00
CMakeLists.txt [cmake] fixes for XCode when having languages other than C/C++ (#3772) 2026-03-26 04:46:43 +01:00
hid_core.cpp hid_core: Move hid to it's own subproject 2024-01-05 11:41:15 -06:00
hid_core.h hid_core: Move hid to it's own subproject 2024-01-05 11:41:15 -06:00
hid_result.h service: hid: Fully implement touch resource 2024-01-28 18:27:25 -06:00
hid_types.h Merge pull request #13135 from german77/hid-interface 2024-02-27 12:26:26 -05:00
hid_util.h service: hid: Create abstracted pad structure 2024-01-11 19:35:04 -06:00
resource_manager.cpp [common/logging] Simplify logging logic and fix issues when logging before system is created (#3688) 2026-03-12 18:29:15 +01:00
resource_manager.h service: hid: Move and migrate AppletResource and ActiveVibrationDevice 2024-02-23 17:49:02 -06:00