core: Fix out-of-bounds access by TICK event #487
The error is caused in layer_swtich_get_action() and fails to access layer_pressed[][]
This commit is contained in:
parent
f896d3350f
commit
df7ce59d1c
2 changed files with 4 additions and 0 deletions
|
@ -531,6 +531,8 @@ void clear_keyboard_but_mods(void)
|
|||
|
||||
bool is_tap_key(keyevent_t event)
|
||||
{
|
||||
if (IS_NOEVENT(event)) { return false; }
|
||||
|
||||
action_t action = layer_switch_get_action(event);
|
||||
|
||||
switch (action.kind.id) {
|
||||
|
|
|
@ -148,6 +148,8 @@ static uint8_t layer_pressed[MATRIX_ROWS][MATRIX_COLS] = {};
|
|||
#endif
|
||||
action_t layer_switch_get_action(keyevent_t event)
|
||||
{
|
||||
if (IS_NOEVENT(event)) return (action_t)ACTION_NO;
|
||||
|
||||
uint8_t layer = 0;
|
||||
#ifndef NO_TRACK_KEY_PRESS
|
||||
if (event.pressed) {
|
||||
|
|
Reference in a new issue