From 5f2bbe7cb8bf6dbaf9e2f65d5c72dad6f1343645 Mon Sep 17 00:00:00 2001 From: WitteShadovv <26429638+WitteShadovv@users.noreply.github.com> Date: Mon, 24 Aug 2026 10:58:57 +0200 Subject: [PATCH] virtual_pointer: Use saturating math for the v120 value discrete arrives from the client as an i32, so discrete * 120 overflows past 17895697 and panics with overflow-checks on. The virtual pointer is behind client_is_unrestricted, so this isn't reachable from a sandboxed client, but it still shouldn't be able to abort the compositor. --- src/protocols/virtual_pointer.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/protocols/virtual_pointer.rs b/src/protocols/virtual_pointer.rs index 0d1a6f6f..233133f8 100644 --- a/src/protocols/virtual_pointer.rs +++ b/src/protocols/virtual_pointer.rs @@ -516,7 +516,9 @@ where } }; pointer.mutate_axis_frame(Some(time), |frame| { - frame.value(axis, value).v120(axis, discrete * 120) + frame + .value(axis, value) + .v120(axis, discrete.saturating_mul(120)) }); } zwlr_virtual_pointer_v1::Request::Destroy => {}