From 11bb4b1b730101fbd0ad8892d0490497d90134fe Mon Sep 17 00:00:00 2001 From: Herman Semenoff Date: Sun, 30 Aug 2026 13:22:04 +0300 Subject: [PATCH] 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 --- mi/mipointer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mi/mipointer.c b/mi/mipointer.c index 800a1f1eb7..615f737fbf 100644 --- a/mi/mipointer.c +++ b/mi/mipointer.c @@ -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) {