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 overflow #244

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix overflow #244

wants to merge 3 commits into from

Conversation

za3k
Copy link

@za3k za3k commented Aug 4, 2022

I believe this fixes issue #239, where args.flags was getting clobbered by an overflow

The problem was that sizeof(char_or_func) is 129, not 128, due to the trailing null byte.

However, I've tested logkeys on two computers, and on both I have unrelated keymap issues. Could someone please make sure this isn't breaking anything horribly before merging it? (ex. that I'm not chopping off a key?)

Fixes #239.

@za3k
Copy link
Author

za3k commented Aug 4, 2022

Nope, definitely this has some issues. Can you figure out the correct fix?

$ sudo logkeys --export-keymap=a.map
logkeys: ../../src/keytables.cc:43: bool logkeys::is_char_key(unsigned int): Assertion `code < sizeof(char_or_func)-1' failed.

Edit: I had a hard time figuring out if keycodes are 0-indexed or 1-indexed in the code

@za3k
Copy link
Author

za3k commented Aug 4, 2022

Best guess is that this works now. I think it was only an issue on keyboards with 128+ keys? Certainly I can't reproduce it on all machines.

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.

--no-timestamps not working
1 participant