[PATCH] xfixes: let PointerBarrierClient->device_ids point to allocated memory

Peter Hutterer peter.hutterer at who-t.net
Thu Nov 15 21:36:56 PST 2012


"Fixed" up Jasper's original patch [1] to use pointers instead of
zero-length arrays but didn't actually set the pointer to anywhere.

[1] 9a536820f6174befb22431bab375ef1af0a1ec29

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
device_ids[0] is a gnu-ism, having device_ids[] is C99, so let's go with the
old, boring style.

 xfixes/cursor.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 7c223dd..bd175b4 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -1300,6 +1300,10 @@ CreatePointerBarrierClient(ScreenPtr screen, ClientPtr client,
 
     ret->screen = screen;
     ret->num_devices = stuff->num_devices;
+    if (ret->num_devices > 0)
+        ret->device_ids = (int*)&ret[1];
+    else
+        ret->device_ids = NULL;
 
     in_devices = (CARD16 *) &stuff[1];
     for (i = 0; i < stuff->num_devices; i++) {
-- 
1.7.11.7



More information about the xorg-devel mailing list