[PATCH] Xi: fix length checks for swapped clients

Peter Hutterer peter.hutterer at who-t.net
Mon Mar 7 17:16:14 PST 2011


On Mon, Mar 07, 2011 at 06:55:19PM +0100, Julien Cristau wrote:
> ChangeDeviceProperty and XIChangeProperty are followed by some data, so
> use REQUEST_AT_LEAST_SIZE instead of REQUEST_SIZE_MATCH.
> 
> X.Org bug#35082 <https://bugs.freedesktop.org/show_bug.cgi?id=35082>
> 
> Reported-by: Markus Fleschutz <markus.fleschutz at x-software.com>
> Signed-off-by: Julien Cristau <jcristau at debian.org>

merged, thanks.

Cheers,
  Peter

> ---
>  Xi/xiproperty.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
> index 17835e2..83ce930 100644
> --- a/Xi/xiproperty.c
> +++ b/Xi/xiproperty.c
> @@ -1051,11 +1051,11 @@ SProcXChangeDeviceProperty (ClientPtr client)
>      char n;
>      REQUEST(xChangeDevicePropertyReq);
>  
> +    REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
>      swaps(&stuff->length, n);
>      swapl(&stuff->property, n);
>      swapl(&stuff->type, n);
>      swapl(&stuff->nUnits, n);
> -    REQUEST_SIZE_MATCH(xChangeDevicePropertyReq);
>      return (ProcXChangeDeviceProperty(client));
>  }
>  
> @@ -1295,12 +1295,12 @@ SProcXIChangeProperty(ClientPtr client)
>      char n;
>      REQUEST(xXIChangePropertyReq);
>  
> +    REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
>      swaps(&stuff->length, n);
>      swaps(&stuff->deviceid, n);
>      swapl(&stuff->property, n);
>      swapl(&stuff->type, n);
>      swapl(&stuff->num_items, n);
> -    REQUEST_SIZE_MATCH(xXIChangePropertyReq);
>      return (ProcXIChangeProperty(client));
>  }
>  
> -- 
> 1.7.2.5


More information about the xorg-devel mailing list