wlr_virtual_pointer: Set axis source on all axis

Currently it is possible to crash a wlroots compositor by setting any
axis source other than 0 and sending an axis event in the HORIZONTAL
direction from wlr_virtual_pointer since the axis source is only set on
the first axis.
This then hits the assert in wlr_seat_pointer.c:332.

Fix by always setting the source on all axis.
This commit is contained in:
David96 2025-02-02 20:47:56 +01:00 committed by David Leppla-Weber
parent 8f7d763ad1
commit aef84f0e4d

View file

@ -134,8 +134,11 @@ static void virtual_pointer_axis_source(struct wl_client *client,
if (pointer == NULL) {
return;
}
pointer->axis_event[pointer->axis].pointer = &pointer->pointer;
pointer->axis_event[pointer->axis].source = source;
int n_axis = sizeof(pointer->axis_event) / sizeof(pointer->axis_event[0]);
for (int i = 0; i < n_axis; i++) {
pointer->axis_event[i].pointer = &pointer->pointer;
pointer->axis_event[i].source = source;
}
}
static void virtual_pointer_axis_stop(struct wl_client *client,