[PATCH] cursor: Fix device-specific pointer barriers

Jasper St. Pierre jstpierre at mecheye.net
Thu Nov 15 12:04:22 PST 2012


From: "Jasper St. Pierre" <jstpierre at mecheye.net>

This code was wrongly changed when the patches were landed. If this is
changed from an array to a pointer, then it would have to point somewhere.
We're allocating the device IDs array inline with the main structure as a
flexible array, so we can't use a pointer, as it will point at garbage when
we try to write to it.

Signed-off-by: Jasper St. Pierre <jstpierre at mecheye.net>
---
 xfixes/cursor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 7c223dd..7ca48c8 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -120,7 +120,7 @@ struct PointerBarrierClient {
     struct PointerBarrier barrier;
     struct xorg_list entry;
     int num_devices;
-    int *device_ids; /* num_devices */
+    int device_ids[0]; /* num_devices */
 };
 
 /*
-- 
1.8.0



More information about the xorg-devel mailing list