Commit 274d03b
committed
src/keycode: fix buffer overflow
At
https://github.com/octalmage/robotjs/blob/b26c7ee0e3dd05420370350e540c48ae9d38f06c/src/keycode.c#L98,
`sizeof(void*)` bytes (probably 8) are written to a memory
segment of 2 bytes (a 16-bit CGKeycode variable), resulting in all
kinds of weird behaviour, like unrelated variables getting NULLed.
Making `code` a a type that can hold `sizeof(void*)` bytes fixes this.
Closes #5701 parent 603de61 commit 274d03b
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
0 commit comments