[PATCH] xfixes: let PointerBarrierClient->device_ids point to allocated memory
Jasper St. Pierre
jstpierre at mecheye.net
Sun Nov 18 18:02:21 PST 2012
Reviewed-By: Jasper St. Pierre <jstpierre at mecheye.net>
On Fri, Nov 16, 2012 at 12:36 AM, Peter Hutterer
<peter.hutterer at who-t.net>wrote:
> "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
>
>
--
Jasper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20121118/354b6731/attachment.html>
More information about the xorg-devel
mailing list