Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Add key event check to is_tap_record and remove is_tap_key #18063

Merged
merged 2 commits into from
Aug 15, 2022

Conversation

KarlK90
Copy link
Member

@KarlK90 KarlK90 commented Aug 15, 2022

Description

...as it is called with tick events and this would generate out of bound access (col: 255, row: 255) in keymaps in keymap_key_to_keycode though #13619 add a mitigation.. Unit-tests that previously failed are enabled again.

is_tap_key is removed as well because it is not used in the code base and subject to the same bug.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

  • Out of bounds access of keymaps when tapping keys are held longer then one iteration.

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added the core label Aug 15, 2022
@KarlK90 KarlK90 changed the title [Bug] Add event check to is_tap_record and remove is_tap_key [Bug] Add key event check to is_tap_record and remove is_tap_key Aug 15, 2022
@KarlK90 KarlK90 requested a review from a team August 15, 2022 13:38
@KarlK90 KarlK90 added the bug label Aug 15, 2022
...as it is called with tick events and this will generate out of bound
access in keymaps.
...and subject to the same bug as is_tap_record.
@KarlK90 KarlK90 force-pushed the fix/is-tap-record-oob branch from be2e038 to bcac323 Compare August 15, 2022 14:06
Copy link
Contributor

@sigprof sigprof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's strange how this ever worked before without the accidental mitigation — probably by pure chance.

@KarlK90 KarlK90 merged commit 8ce946b into qmk:develop Aug 15, 2022
@KarlK90
Copy link
Member Author

KarlK90 commented Aug 15, 2022

Absolutely, I wonder how many heisenbugs where caused by this.

@IsaacElenbaas
Copy link
Contributor

I ran into some in #15889 and wouldn't have noticed if the tests hadn't caught it as most behaviors were correct 🤷‍♂️ I expect them doing so saved me quite a bit of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants