Skip to content

On macOS, prevent key_event_buffer overflows

Bernhard Liebl requested to merge github/fork/poke1024/macos-keybuffer into master

On macOS, key_event_buffer is an unguarded C array that will overflow in paste operations > 512 chars (see insertText).

This makes the buffer a resizing vector.

The same kind of implementation exists for Windows, but there it's ok, as only a single char will be added per event (WM_CHAR), and there's an ERR_BREAK guarding against buffer overflow. On OSUWP, there's also a guard. On X11 there's no key event buffering of this kind.

Merge request reports