mi: guard against NULL event pointer

In miPointerSetPosition(), ensure nevents and events pointers are non-NULL
before checking for and updating barrier event coordinates to avoid potential
NULL pointer dereferences
This commit is contained in:
Herman Semenoff 2026-08-30 13:22:04 +03:00 • committed by Enrico Weigelt
commit 11bb4b1b73

View file

@ -702,7 +702,7 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx,
/* check if we generated any barrier events and if so, update root x/y
* to the fully constrained coords */
if (should_constrain_barriers) {
if (should_constrain_barriers && nevents && events) {
for (i = 0; i < *nevents; i++) {
if (events[i].any.type == ET_BarrierHit ||
events[i].any.type == ET_BarrierLeave) {