mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-15 08:22:07 -04:00
backend/libinput: assert buffer overflow in add_pad_group_from_libinput
This commit is contained in:
parent
a79f7096a6
commit
140197f56d
1 changed files with 5 additions and 0 deletions
|
|
@ -40,6 +40,7 @@ static void add_pad_group_from_libinput(struct wlr_tablet_pad *pad,
|
|||
size_t ring = 0;
|
||||
for (size_t i = 0; i < pad->ring_count; ++i) {
|
||||
if (libinput_tablet_pad_mode_group_has_ring(li_group, i)) {
|
||||
assert(ring < group->ring_count);
|
||||
group->rings[ring++] = i;
|
||||
}
|
||||
}
|
||||
|
|
@ -53,9 +54,11 @@ static void add_pad_group_from_libinput(struct wlr_tablet_pad *pad,
|
|||
if (group->strips == NULL) {
|
||||
goto group_fail;
|
||||
}
|
||||
|
||||
size_t strip = 0;
|
||||
for (size_t i = 0; i < pad->strip_count; ++i) {
|
||||
if (libinput_tablet_pad_mode_group_has_strip(li_group, i)) {
|
||||
assert(strip < group->strip_count);
|
||||
group->strips[strip++] = i;
|
||||
}
|
||||
}
|
||||
|
|
@ -69,9 +72,11 @@ static void add_pad_group_from_libinput(struct wlr_tablet_pad *pad,
|
|||
if (group->buttons == NULL) {
|
||||
goto group_fail;
|
||||
}
|
||||
|
||||
size_t button = 0;
|
||||
for (size_t i = 0; i < pad->button_count; ++i) {
|
||||
if (libinput_tablet_pad_mode_group_has_button(li_group, i)) {
|
||||
assert(button < group->button_count);
|
||||
group->buttons[button++] = i;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue