mirror of
https://github.com/cy384/ssheven.git
synced 2026-05-15 06:05:53 -06:00
[GH-ISSUE #13] Potential buffer over-read #12
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
question
upkeep
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/ssheven#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jonirons on GitHub (Dec 3, 2021).
Original GitHub issue: https://github.com/cy384/ssheven/issues/13
I believe the following lines allow for a buffer over-read (however remote the possibility):
d8753b3676/ssheven.c (L35)d8753b3676/ssheven.c (L39)The arrays are length
255rather than256; in both cases, I think it's possible for the array to end up being indexed with[255], which over-reads the buffer.When reading from
ascii_to_control_code, you might send garbage across the wire:d8753b3676/ssheven.c (L576)For
keycode_to_ascii, the index to the above read might also end up being garbage:d8753b3676/ssheven.c (L571)If this looks like a problem, you'll also want to update this loop:
d8753b3676/ssheven.c (L50)to:
I don't know that any Mac keyboard would even have a key code on it equal to
0xff, nor do I know if the translation to "ASCII" would ever give0xff. This latter seems like it could be possible if there is a layout with aˇkey.@cy384 commented on GitHub (Dec 3, 2021):
thanks for the report, and for reading the code closely! should be an easy fix, I'll get to it this evening
@cy384 commented on GitHub (Dec 5, 2021):
should be fixed, thanks again