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

fix(behaviors): Fix use after free in sticky key #1745

Merged
merged 1 commit into from Apr 10, 2023

Conversation

joelspadin
Copy link
Collaborator

Fixed an issue where the sticky key behavior would call ZMK_EVENT_RAISE_AFTER(), which would free the provided event, but then it would keep using that now-freed event data.

Fixed an issue where the sticky key behavior would call
ZMK_EVENT_RAISE_AFTER(), which would free the provided event, but then
it would keep using that now-freed event data.
@joelspadin
Copy link
Collaborator Author

I just discovered #1586, which this is nearly identical to. This PR marks the copy as const and adds a comment explaining why it's needed, while the other one adds extra tests. Maybe we should take the behavior_sticky_key.c from this PR and the tests from the other?

Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

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

Good catch! Thanks.

@petejohanson petejohanson merged commit 064aff6 into zmkfirmware:main Apr 10, 2023
42 checks passed
keymap-editor bot added a commit to ColinWragg/Adv360-Pro-ZMK that referenced this pull request Apr 17, 2023
This is likely a problem due to zmkfirmware/zmk#1745.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants