Skip to content

input: fix out of bound/race in pad_buttons_pressed#17673

Open
na-na-hi wants to merge 2 commits intompv-player:masterfrom
na-na-hi:tablet-fix
Open

input: fix out of bound/race in pad_buttons_pressed#17673
na-na-hi wants to merge 2 commits intompv-player:masterfrom
na-na-hi:tablet-fix

Conversation

@na-na-hi
Copy link
Copy Markdown
Contributor

Fixes OOB read/write and access without acquiring lock.

When buttons > MP_MAX_TABLET_PAD_BUTTONS and the value is stored in
ictx->tablet_pad_buttons, the next mp_input_set_tablet_pad_focus call
will cause out of bound write, and mp_property_tablet_pos will cause
out of bound read.

Fix this by limiting ictx->tablet_pad_buttons range.

Fixes: 0fbf20f
mp_input_get_tablet_pos stores the address to an array that is protected
by lock, and the content is accessed without acquiring lock.

Fix this by writing the values to an array inside mp_input_get_tablet_pos.

Fixes: 0fbf20f
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.

1 participant